Provides Microsoft Graph API Email integration for Symfony Mailer.
You will need to:
- Register an application in your Microsoft Azure portal,
- Grant this application the Microsoft Graph Mail.Sendpermission,
- Create a secret for that app.
# MAILER
MAILER_DSN=microsoftgraph+api://CLIENT_APP_ID:CLIENT_APP_SECRET@default?tenantId=TENANT_IDThis will default to graph.microsoft.com for the Graph API and login.microsoftonline.com for authentication.
If you need to use third parties operated or specific regions Microsoft services (China, US Government, etc.), you can specify the Graph Endpoint and the Auth Endpoint explicitly.
# MAILER e.g. for China
MAILER_DSN=microsoftgraph+api://CLIENT_APP_ID:CLIENT_APP_SECRET@microsoftgraph.chinacloudapi.cn?tenantId=TENANT_ID&authEndpoint=login.partner.microsoftonline.cnThe exact URLs can be found in the Microsoft documentation:
You can also specify to not save the messages to sent items using the noSave parameter:
# MAILER
MAILER_DSN=microsoftgraph+api://CLIENT_APP_ID:CLIENT_APP_SECRET@default?tenantId=TENANT_ID&noSave=trueBeware that the sender email address needs to be an address of an account inside your tenant.