Download the PHP package innoge/laravel-msgraph-mail without Composer

On this page you can find all versions of the php package innoge/laravel-msgraph-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-msgraph-mail

Laravel Microsoft Graph Mail Driver Package

Latest Version on Packagist Laravel Version GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a Microsoft Graph mail driver for Laravel. It is an alternative when you don't want to use the deprecated and unsecure Basic Auth SMTP driver with Microsoft Office 365.

Version 2.x supports PHP 8.2+ and Laravel 11–13, authenticates with a client secret or a client certificate, and automatically sends large attachments through Microsoft Graph upload sessions. Upgrading from 1.x? See UPGRADE.md.

Installation

You can install the package via composer:

Configuration

Register the Azure App

Microsoft Azure AD Configuration

I have written a detailed Blog Post how you can configure your Microsoft Azure AD Tenant. Sending Mails with Laravel and Microsoft Office 365 the secure way

I want to figure it out on my own

You need to register an Azure App in your Azure AD tenant. You can do this by following the steps in the Microsoft Graph documentation.

After creating the App you have to add the following permissions to the App: Mail.Send (Application permission) you will find it under the "Microsoft Graph" section.

Now you have to Grant Admin Consent for the App. You can do this by following the steps in the Microsoft Graph documentation.

Configuring your Laravel app

First you need to add a new entry to the mail drivers array in your config/mail.php configuration file:

For the client_id, client_secret and tenant_id you need to use the values from the Azure App you created in the previous step.

The from block is optional: when it is omitted entirely, the global mail.from configuration is used. The from address must be the primary SMTP address of a real mailbox in your tenant.

Now you can switch your default mail driver to the new microsoft-graph driver by setting the env variable:

Certificate authentication

Instead of a client secret you can authenticate with a client certificate (no more expiring secrets). Upload the certificate to the Azure app registration (Certificates & secrets → Certificates), then configure:

Both values accept either raw PEM content (starting with -----BEGIN) or a path to a PEM file. When client_certificate is configured it takes precedence over client_secret. Certificate authentication requires the openssl PHP extension.

Saving mails to Sent Items

The save_to_sent_items option controls whether sent mail is stored in the sender mailbox's "Sent Items" folder (default: false). Individual mailables can override the configured default through a Symfony metadata header:

Large attachments

Messages whose total size exceeds Microsoft Graph's ~4 MB sendMail request limit are sent automatically through a draft message with chunked attachment upload sessions. This path additionally requires the Mail.ReadWrite application permission (plus admin consent). Two things to know:

AI Agent Support

This package ships with a Laravel Boost skill (msgraph-mail) covering configuration, troubleshooting, and a step-by-step Azure app registration guide. If your project uses Boost, the skill is installed automatically via php artisan boost:install or php artisan boost:update --discover.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-msgraph-mail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.14.0
symfony/mailer Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package innoge/laravel-msgraph-mail contains the following files

Loading the files please wait ...