Provides integration between the Symfony Mailer
and Office365 Graph API
.
- Tested on:
Symfony 6.4
onphp 8.1
Symfony 5.4
onphp 7.4
- Should work on all Symfony 5.x, 6.x, 7.x instances
- Feel free to report issues on github if you have them
- Does not require the Microsoft Graph API Client (speaks to Graph API directly)
- No Guzzle or other external libraries needed, uses only Symfony HTTP Client and Symfony Mailer
composer require vitrus/symfony-office-graph-mailer
We might change this package to be a bundle so this is no longer needed in the future
Vitrus\SymfonyOfficeGraphMailer\Transport\GraphApiTransportFactory:
tags: ['mailer.transport_factory']
MAILER_DSN=microsoft-graph-api://{CLIENT_ID}:{CLIENT_SECRET}@{TENANT}
The tenant you use here should have permissions to send e-mail, and have access
to the user you will configure as sender
in your e-mails!
Messages are automatically stored in Office 365 Sent Items
folder, you can disable this with a custom header:
$message = (new Email())->subject($subject);
// add (falsy) text header to your Email
$message->getHeaders()->addTextHeader('X-Save-To-Sent-Items', 'false');