The idea is:
Add Microsoft Graph as an email delivery option for n8n’s user-management emails (invites, password resets, workflow/credential sharing), alongside the existing SMTP transport. This would introduce a new microsoftGraph email mode backed by the Microsoft Graph sendMail API using the OAuth2 client-credentials (app-only) flow, and a few new config values:
N8N_EMAIL_MODE=microsoftGraphMICROSOFT_GRAPH_CLIENT_IDMICROSOFT_GRAPH_CLIENT_SECRETMICROSOFT_GRAPH_TENANT_IDMICROSOFT_GRAPH_SENDER
The existing UserManagementMailer would select SMTP or Microsoft Graph based on configuration, so nothing changes for current SMTP users.
My use case:
We run n8n self-hosted in a Microsoft 365 / Entra ID environment where basic authentication for SMTP is disabled by policy, and outbound mail is expected to go through an approved Entra app registration rather than SMTP credentials. Today that means we can’t reliably send n8n’s system emails (user invites, password resets, sharing notifications) through our Microsoft tenant. Being able to point n8n at Microsoft Graph with an app registration lets these emails send through our sanctioned identity and mail flow without standing up a separate SMTP relay.
I think it would be beneficial to add this because:
Microsoft is phasing out Basic Authentication for Exchange Online, and many organizations already enforce modern authentication (OAuth2) and disable basic-auth SMTP entirely. For those users, SMTP-only support means n8n’s user-management emails either don’t work or require an insecure/unsupported workaround. Supporting Microsoft Graph with the client-credentials flow lets n8n send transactional email in a way that aligns with how Microsoft 365 tenants are increasingly configured, using a dedicated app registration with scoped permissions instead of shared SMTP credentials.
Any resources to support this?
- Microsoft Graph `sendMail` API: user: sendMail - Microsoft Graph v1.0 | Microsoft Learn
- OAuth2 client-credentials flow: OAuth 2.0 client credentials flow on the Microsoft identity platform - Microsoft identity platform | Microsoft Learn
- Microsoft’s deprecation of Basic Authentication in Exchange Online (background on why OAuth2/Graph is needed): Deprecation of Basic authentication in Exchange Online | Microsoft Learn
Are you willing to work on this?
Yes, I’ve already opened a PR implementing this: n8n-io/n8n#34630. It adds the `GraphMailer`, the new config values, wires up `UserManagementMailer`, and includes unit tests for token retrieval, sendMail payload generation, multiple recipients, token reuse, and Graph API failures.