Forum Discussion
chanlerone
May 16, 2023Copper Contributor
Sending email with OAuth authentication to Office 365 using MgGraph
Hi all, I'm trying to send emails using MgGraph and Modern Authentication and somehow this fails. The sender receives an auto-respond from Exchange saying; Diagnostic information for admin...
Deleted
May 16, 2023Try to check SPF Record and add MgGraph to it, and also check connection filter policy if enabled
If I have answered your question, please mark your post as Solved If you like my response, please give it a Like Appreciate your Kudos! Proud to contribute! 🙂 |
- chanleroneMay 17, 2023Copper ContributorWhat do you mean with SPF record of MgGraph? AFAIK there is only Exchange Online's record we need to add [include:spf.protection.outlook.com] according to: https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/email-authentication-spf-configure?view=o365-worldwide#create-or-update-your-spf-txt-record
And which connection filter do you refer to?
Furthermore, the rejection comes from O365 servers: AS8PR08MB9314.eurprd08.prod.outlook.com
What I would expect is that I am posting a request to the Graph API that is accepted. The API's SMTP services will go ahead and try to send the email to Exchange Online, which in turn would need to deliver this to the intended recipient.
If Exchange Online already reject the email that is being delivered by the API, then Graph's servers would not be trusted by Exchange Online. How can I fix this?