title: Is it possible to use OAuth 2.0 for Office365 SMTP?
body: <p>I have an email application for sending emails that was written in house.  We have set it with the option to use OAuth 2.0 with GMail (personal and business accounts) and Outlook.com accounts without issues.  </p>
  
  <p>We can also authentication with user ids and passwords but we prefer OAuth 2.0 as we don't save passwords anywhere that way.</p>
  
  <p>We now have requests to do this for Office365 accounts.</p>
  
  <p>I notice that the hello message on the Office365 smtp server (smtp.office365.com port 587) does not offer the XOAUTH2 option.</p>
  
  <pre><code>250-BY2PR0601CA0005.outlook.office365.com Hello [xx.xx.xx.xx]
  250-SIZE 157286400
  250-PIPELINING
  250-DSN
  250-ENHANCEDSTATUSCODES
  250-AUTH LOGIN
  250-8BITMIME
  250-BINARYMIME
  250 CHUNKING
  </code></pre>
  
  <p>But, the SMTP server for outlook.com does:</p>
  
  <pre><code>250-BLU436-SMTP14.smtp.hotmail.com Hello [xx.xx.xx.xx]
  250-TURN
  250-SIZE 41943040
  250-ETRN
  250-PIPELINING
  250-DSN
  250-ENHANCEDSTATUSCODES
  250-8bitmime
  250-BINARYMIME
  250-CHUNKING
  250-VRFY
  250-AUTH LOGIN PLAIN XOAUTH2
  250 OK
  </code></pre>
  
  <p>Is this possible to do with Office365?  If not, can we point Office365 users to the outlook.com smtp server (smtp-mail.outlook.com) or are they totally different?</p>
  
  <p>We'd rather not use the APIs just for sending emails if possible as the RESTful APIs for each provider will of course be quite different.  </p>
  
  <p>The reason for using OAuth 2.0 when sending email with an Office365 account is that we don't want to have to store passwords on our server.  Also, if the user changes their password, we won't know unless they tell us or manually update it on our system side.</p>
  
  <p>Using OAuth 2.0 this would solve this problem and allow the application to flow like with other email providers.</p>