Hello,
What do I need to do on the corporate admin365 side to be able to send emails from a distribution box or emial with a password from server smtp.office365.com
"Error: Invalid login: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [WA2P291CA0028.POLP291.PROD.OUTLOOK.COM 2025-05-27T11:32:59.054Z 08DD9C8869AEB511]"
You need to speak to your M365 admin. You will need to register an app in Azure Active Directory (AAD). Programmatic access to M365 is not permitted except via registered apps.
1 Like
And once you register an App, you will intern get a Client Secret & App ID.
Using that will yield a token (OAuth token) that will need to be used for authentication against Graph.
When registering the app, ensure ONLY impersonation is allowed in the API perms, not Application Context - else someone getting your API keys, can send from ANY mailbox, BAD!
With impersonation, both API keys, and the senders identity creds are needed.
All this is a little outside of the scope on the forums, but plenty of guides on the web.
1 Like
But the bottom line is that you will not be able to do anything without the support of your corporate IT department who will (if they are of any use at all) tightly control access to Azure AD.
1 Like
I gave up on 365 smtp... just get a free smtp2go account and use basic auth
Nice... easy.. works
Though, if you are using that for work, you probably just broke a load of organisation policies, maybe even some terms and conditions of use.
I pay for smtp2go and I make the policies so I guess im are fine 
1 Like