How to use OAuth2 for SMTP with Microsoft 365 without any end user interaction? - Just for background processing #1768
-
Hi Space! We are in the process of integrating MailKit into one of our software projects. As Microsoft is going to discontinue SMTP AUTH in 2025 (see details here https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-online-to-retire-basic-auth-for-client-submission-smtp/ba-p/4114750), we are wondering how to use MailKit correctly without Basic Authentication for background processing. We have searched a lot and found many examples how to use MailKit and Basic Auth, but there is (almost) no example showing the whole process of using MailKit with OAuth2 only. So we have the following questions / suggestions:
Or are we missing something here and not understanding the OAuth2 process correctly? Thank you in advance for any helpful input! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi Xian, I should probably update the examples in the Documentation directory (I forgot I even had a sample there), but the canonical documentation for MailKit+OAuth2 with Exchange can be found here: https://github.com/jstedfast/MailKit/blob/master/ExchangeOAuth2.md That details 2 different methods of OAuth2, 1 that requires user interaction and 1 that is meant for (web) services where interaction is not possible. |
Beta Was this translation helpful? Give feedback.
Hi Xian,
I should probably update the examples in the Documentation directory (I forgot I even had a sample there), but the canonical documentation for MailKit+OAuth2 with Exchange can be found here: https://github.com/jstedfast/MailKit/blob/master/ExchangeOAuth2.md
That details 2 different methods of OAuth2, 1 that requires user interaction and 1 that is meant for (web) services where interaction is not possible.