title: SmtpClient.Send is working, but SmtpClient.SendMailAsync is not working on smtp.office365.com
body: <p>I developed two methods: SendEmailBySmtp() and SendEmailAsyncBySmtp() that is using SmtpClient.Send and SmtpClient.SendMailAsync respectively.<BR />Currently the first method is working, but the second is not. It has no error, but no email out.<BR />
  How can I fixed it?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          SendEmailBySmtp();
          SendEmailAsyncBySmtp();
      }
  
      static void SendEmailBySmtp()
      {
          MailMessage message = new MailMessage() 
          { 
              From = new MailAddress("test@example.com", "Test User"), 
              Subject = "Subject", 
              Body = "Body"
          };
          message.To.Add("test@example.com");
          message.CC.Add("test@example.com");
          message.BodyEncoding = UTF8Encoding.UTF8;
          message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
          using (SmtpClient client = new SmtpClient())
          {
              client.Port = 587;
              client.Host = "smtp.office365.com";
              client.EnableSsl = true;
              client.UseDefaultCredentials = false;
              client.Credentials = new System.Net.NetworkCredential("test@example.com", "password");
              client.Send(message);
          }
      }
  
      static async Task SendEmailAsyncBySmtp()
      {
          MailMessage message = new MailMessage()
          {
              From = new MailAddress("test@example.com", "Test User"),
              Subject = "Subject",
              Body = "Body"
          };
          message.To.Add("test@example.com");
          message.CC.Add("test@example.com");
          message.BodyEncoding = UTF8Encoding.UTF8;
          message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
          using (SmtpClient client = new SmtpClient())
          {
              client.Port = 587;
              client.Host = "smtp.office365.com";
              client.EnableSsl = true;
              client.UseDefaultCredentials = false;
              client.Credentials = new System.Net.NetworkCredential("test@example.com", "password");
              await client.SendMailAsync(message);
          }
      }
  }
  </code></pre>