title: Sending Email via office 365 SMTP server require authentication error
body: <p>I'm trying to set up our no-reply email notification with our office 365 account. I've requested to admin to uncheck the SMTP auth and created the app password but still, I'm getting an error on sending an email. Email has MFA</p>
  <p>SMTP config</p>
  <ul>
  <li>Username - the no-reply email account</li>
  <li>Password - app password generated from
  <a href="https://account.activedirectory.windowsazure.com/AppPasswords.aspx" rel="nofollow noreferrer">https://account.activedirectory.windowsazure.com/AppPasswords.aspx</a></li>
  <li>SMTP Host is smtp.office365.com</li>
  <li>PORT used is 587</li>
  </ul>
  <p>Still throwing exception below</p>
  <blockquote>
  <p>The SMTP server requires a secure connection or the client was not
  authenticated. The server response was: 5.7.57 Client not
  authenticated to send mail. [HK2PR02CA0208.apcprd02.prod.outlook.com]</p>
  </blockquote>
  <pre><code>MailMessage message = new MailMessage();
  SmtpClient smtp = new SmtpClient();
  message.From = new MailAddress(fromAddress);
  message.To.Add(new MailAddress(recipient));
  message.Subject = subject;
  message.IsBodyHtml = true; //to make message body as html  
  message.Body = content;
  smtp.Port = port;
  smtp.Host = host;
  smtp.EnableSsl = true;
  smtp.UseDefaultCredentials = false;
  smtp.Credentials = new NetworkCredential(userName, password);
  smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
  smtp.Send(message);
  </code></pre>