The process of building custom applications and tools that interact with Microsoft Exchange Server
Hello Tyfone Inc
Thank you for reaching out to the Q&A Forum.
Based on your description, I would like to share some information from my research that I hope will be helpful that this error generally indicates Permission Type Mismatch or Mailbox Restriction
- Permission Type Mismatch: You are looking for "Application Permissions" (Service Principal), but SMTP only supports "Delegated Permissions."
- Mailbox Restriction: The SMTP AUTH protocol is disabled on the specific mailbox you are trying to send from.
You likely cannot find the permissions because you are looking under "Microsoft Graph" or attempting to use "Application Permissions". Microsoft does not support SMTP via OAuth with Application Permissions (Client Credentials flow).
Use Delegated Permissions (User Interactive flow).
- Go to the Microsoft Entra admin center > App registrations > Select your App.
- Go to API permissions > + Add a permission and select the tab APIs my organization uses
- Search for Office 365 Exchange Online (Resource ID: 00000002-0000-0ff1-ce00-000000000000) and select it > Select Delegated permissions and check SMTP.Send and click Add permissions.
Even with the correct token, error 5.7.3 often means the mailbox itself is blocking SMTP connections. This is disabled by default in many newer tenants.
You should enable this via Exchange Online PowerShell: Enable or disable SMTP AUTH in Exchange Online | Microsoft Learn
I hope this information is helpful.
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.