craftcms/microsoft-graph-mailer

Microsoft Graph Mailer adapter for Craft CMS

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:craft-plugin

pkg:composer/craftcms/microsoft-graph-mailer

1.0.0 2025-12-09 18:27 UTC

This package is auto-updated.

Last update: 2025-12-09 18:33:31 UTC


README

Microsoft Graph icon

Microsoft Graph Mailer for Craft CMS

This plugin provides a Microsoft Graph mailer adapter for Craft CMS.

Requirements

This plugin requires Craft CMS 5.8.0 or later, and PHP 8.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Microsoft Graph Mailer”. Then press “Install”.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/microsoft-graph-mailer

# tell Craft to install the plugin
./craft plugin/install microsoft-graph-mailer

Microsoft Prerequisites

  • Microsoft Azure Portal account
  • Microsoft 365 licensed mailbox

Microsoft Setup

1. Create the app

  • Go to ManageApp registrations and press New registration.
  • Give your app a Name.
  • Under Supported account types, select Accounts in this organizational directory only (Single tenant).
  • Press Register. The app will be created, and you’ll be taken to its overview page.

2. Create credentials

  • Beside Client credentials, press Add a certificate or secret.
  • Under Client secrets, press New client secret. Give it a description and preferred expiration timeframe, then press Add.
  • Copy the Application (client) ID, Directory (tenant) ID, and the secret Value somewhere safe. You’ll need these values to configure the Craft CMS mailer.

Note

It won’t be possible to re-retrieve the secret’s value once you’ve left the page.

3. Grant permissions

  • Go to ManageApp registrations[your app]ManageAPI permissions and press Add a permission.
  • Under Microsoft APIs, select Microsoft Graph.
  • Select Application permissions (not Delegated).
  • Select the checkbox for MailMail.Send.
  • Press Add permissions. The permission will show in the table with a status of “Not granted for [your organization name]”.
  • Press Grant admin consent for [your organization name]. The permission should now show in the table with a status of “Granted for [your organization name]”.

Plugin Setup

Once Microsoft Graph Mailer is installed:

  1. Go to SettingsEmail.
  2. Change the Transport Type setting to Microsoft Graph Mailer. Also, ensure that your System Email Address in your Craft Email Settings matches the licensed mailbox you want to send emails from.
  3. Enter your Azure App Client ID (Application (client) ID).
  4. Enter your Azure App Client Secret (secret Value).
  5. Enter your Azure App Tenant ID (Directory (tenant) ID).
  6. If you need to use graph and auth endpoints other than the default, you can fill out Graph Endpoint and Auth Endpoint fields.
  7. If you want to save the messages to sent items, toggle Save to sent items on.
  8. Click Save.