title: Sending Email from Office 365 no longer supports Basic Authentication and SMTP
body: <p>We observe that quite recently our Email were failing to authenticate. Upon finding the reason for such action, we found out that a Policy at Office 365 Admin is causing this issue.</p>
  <blockquote>
  <p>Further, we also found out that it's being blocked by a policy that
  says our App uses a <strong>Legacy Authentication scheme</strong>. Later it was
  understood that Microsoft will stop allowing Basic Authentication
  (Passing a Username and Password as for credentials) in the future and
  any connection which uses IMAPI, POP and SMTP protocols for
  connection. Further communication on Office 365 platform should be
  on minimum TLS 1.1 or 1.2</p>
  </blockquote>
  <p>I am using a Web Job in Azure to execute Emails and for such <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=netframework-4.6.2" rel="nofollow noreferrer"><code>System.Net.Mail.SmtpClient</code></a> for Emailing. This Web Job executes bulk emails. I have checked my App Service, under SSL/TLS properties and have set HTTPS only and TLS 1.2. However, I am using Basic Authentication as the authenticating method. Below is the way I did the coding:</p>
  <pre><code>System.Net.Mail.SmtpClient objSmtpClient = null;
  
  //uses the TLS port 587 with authentication
  ServicePointManager.ServerCertificateValidationCallback = delegate (object s, System.Security.Cryptography.X509Certificates.X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
  objSmtpClient = new System.Net.Mail.SmtpClient(&quot;email.host.com&quot;, 587);
  objSmtpClient.UseDefaultCredentials = false;
  objSmtpClient.Credentials = new NetworkCredential(userName, passWord);
  objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
  objSmtpClient.EnableSsl = true;
  </code></pre>
  <p>According to these facts, I want to know what are the other ways I can authenticate to Office 365 Email service on a .NET Framework and send Emails? If,</p>
  <ol>
  <li>SMTP protocol is not supported</li>
  <li>Basic Authentication is not supported</li>
  </ol>
  <p><strong>References:</strong>
  <a href="https://stackoverflow.com/questions/59735368/can-i-send-smtp-email-through-office365-shared-mailbox">Can I send SMTP email through Office365 shared mailbox?</a></p>