SMTP Email through Office 365 in 2022

Sam 1 Reputation point
2022-05-14T14:15:17.41+00:00

I'm trying to enable the ability to send SMTP email programmatically from an application through Office 365. From what I've pieced together, this requires turning on SMTP for a specific mailbox. However, to do that, Basic Authentication needs to be on for the tenant, which as far as I can tell, is now impossible to do.

Surely, Microsoft must have some solution for apps to send email programmatically now? Any help is greatly appreciated.

Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
507 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,345 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Kyle Armstrong 6 Reputation points
    2022-06-24T21:27:53.263+00:00

    214895-office-settings-to-get-kyocera-printer-working.jpg

    this setting got my smtp settings working on my printer o be able to send emails.

    1 person found this answer helpful.
    0 comments No comments

  2. Kael Yao-MSFT 37,496 Reputation points Microsoft Vendor
    2022-05-16T01:19:45.793+00:00

    Hi @Sam

    However, to do that, Basic Authentication needs to be on for the tenant, which as far as I can tell, is now impossible to do.

    Yes. To use basic auth for SMTP, you may need to disable security defaults for the tenant.
    If it is not possible, you may need to update the application to use modern auth.
    202009-12.png

    Please refer to this link: Basic Authentication Deprecation in Exchange Online – May 2022 Update


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. MgSm Doe 1 Reputation point
    2022-05-16T23:51:46.407+00:00

    @Kael Yao-MSFT I'm sorry but this answer is not helpful. You're just restating what I already stated- that Basic Auth is gone.

    I need to send email programmatically from a .NET application through Exchange 365. How do I do this in 2022? What does "updating the application to use modern auth" mean? Can you point me to some documentation? Happy to change to whatever auth scheme Microsoft wants me to use- I just don't see any documentation anywhere for how to actually do this.


  4. Glen Scales 4,431 Reputation points
    2022-05-18T01:33:22.633+00:00

    Surely, Microsoft must have some solution for apps to send email programmatically now? Any help is greatly appreciated.

    If you just want to send email programmatically then the Graph API is the best solution eg https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=csharp there is a good write up about the whole process on https://zimmergren.net/sending-e-mails-using-microsoft-graph-using-dotnet/

    You can use SMTP as long as your app use oAuth https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth libraries like MailKit support this eg http://www.mimekit.net/docs/html/T_MailKit_Security_SaslMechanismOAuth2.htm . The only thing is currently there is no support for the client credentials flow so you need to authenticate with an actual user account.

    0 comments No comments