title: SmtpClient asp net core 3.0 with IEmailSender work on Windows but not On Linux
body: <p>I have the following situation. I am migrating my .Net MVC to net core 3.0 MVC for my local raspbery pi. I am building my app on the Windows machine where IEmailSender middlewere with SmtpClient is working but on Linux I have the following exception</p>
  
  <pre><code>System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: &lt;my@gmail.com&gt; No such user here
  </code></pre>
  
  <p>I have tried to send the mail from windows and Linux without the <code>IEmailSender</code> and its working fine but with <code>IEmailSender</code> in place I have that error.</p>
  
  <p>The reason to use <code>IEmailSender</code> is because i don't want to scaffold the <code>Identity</code> that is why I use it in my controllers. </p>
  
  <pre class="lang-cs prettyprint-override"><code>services.AddTransient&lt;IEmailSender, EmailSenderCore&gt;(i =&gt;
      new EmailSenderCore(
  
         //Configuration["Gmail"]
         Configuration["RibelleMail"]
     ));
  </code></pre>
  
  <p>My class implementation </p>
  
  <pre class="lang-cs prettyprint-override"><code>public class EmailSenderCore : IEmailSender
  {
      private string mailPass;
  
      public EmailSenderCore(string password)
      {
          mailPass = password;
      }
  
      public Task SendEmailAsync(string emailTo, string subject, string message)
      {
          //return Gmail(mailPass, subject, message, emailTo);
          return Ribelle(mailPass, subject, message, emailTo);
      }
  
      public Task Ribelle(string mailPass, string subject, string message, string emailTo)
      {
          MailAddress from = new MailAddress("my@email") { };
          MailAddress to = new MailAddress(emailTo);
          MailAddress carbonCopy = new MailAddress("my@cc") { };
  
          MailMessage mailMessage = new MailMessage(from,to)
          {
              From = from,
              Subject = subject,
              Body = message,  
          };
  
          mailMessage.CC.Add(carbonCopy);
  
          SmtpClient smtpClient = new SmtpClient("mail.host", 25)
          {
              UseDefaultCredentials = false,
              Credentials = new NetworkCredential("mailUser", mailPass),
              EnableSsl = false
          };
  
          // Send it...         
          return smtpClient.SendMailAsync(mailMessage);
      }
  }
  </code></pre>