Download the PHP package codewrap/laravel-microsoft-graph-mailer without Composer
On this page you can find all versions of the php package codewrap/laravel-microsoft-graph-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-microsoft-graph-mailer
Laravel Microsoft Graph Mailer
A Laravel mail driver that sends email via the Microsoft Graph API using OAuth2 client credentials. Zero external dependencies beyond Laravel itself.
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- An Azure AD / Entra ID app registration with
Mail.Sendapplication permission
Installation
Azure AD Setup
- Go to Azure Portal > App registrations > New registration
- Name your app (e.g. "My App Mailer"), select Single tenant
- Go to API permissions > Add permission > Microsoft Graph > Application permissions > Mail.Send > Grant admin consent
- Go to Certificates & secrets > New client secret — copy the secret value
- From the Overview page, copy the Application (client) ID and Directory (tenant) ID
Restrict Sender Addresses (Recommended)
By default, Mail.Send allows sending as any mailbox in your tenant. To restrict which mailboxes the app can send from, configure an Application Access Policy in Exchange Online:
Configuration
Add the mailer to config/mail.php:
Add to your .env:
The MAIL_FROM_ADDRESS must be a valid mailbox in your Microsoft 365 tenant.
Usage
Once configured as the default mailer, all Mail::send() / Mail::to() calls use Microsoft Graph automatically. No code changes needed.
Limitations
- 3 MB attachment limit — Direct file attachments in
sendMailare limited to 3 MB. Attachments between 3-150 MB require a draft + upload session flow (not yet supported). X-Message-ID— Graph'ssendMailreturns no message ID. The driver generates a local correlation UUID, not an Exchange message ID.
National Clouds
For national cloud deployments (US Gov, China), override the API endpoints in your .env:
License
MIT
All versions of laravel-microsoft-graph-mailer with dependencies
illuminate/cache Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/mail Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.9