Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Symfony Mailer Lite: Microsoft Graph API / oAuth2 Transport

No security coverage Maintenance fixes only 91 sites

This module integrates with Symfony Mailer Lite to send emails via the Microsoft Graph API. It allows you to authenticate and send emails directly through Microsoft 365 or Azure without needing SMTP.

This module enables sending emails through Microsoft Graph API using the
Symfony Mailer Lite module.
It provides a custom transport plugin for sending emails through Microsoft Office 365/Azure
in environments where SMTP authentication is not permitted.

Introduction

The module extends Symfony Mailer Lite to provide Microsoft Graph API integration for
sending emails. It allows you to use the official API instead of SMTP to send
emails directly through Microsoft's infrastructure while leveraging Drupal's mail system.

Requirements

  • Drupal 10.x or 11.x
  • Symfony Mailer Lite
  • Microsoft Azure account with a configured application
  • PHP 8.3 or higher
  • Composer

Installation

The recommended way to install this module is via Composer:

composer require drupal/symfony_mailer_lite_microsoft

Then enable the module either through Drupal UI or using Drush:

drush en symfony_mailer_lite_microsoft

Configuration

  1. First, set up your Microsoft Azure application:

    • Register a new application in Azure Active Directory
    • Configure the necessary permissions for Microsoft Graph API (Mail.Send)
    • Note down your Client ID, Client Secret, and Tenant ID
  2. Navigate to Configuration » System » Symfony Mailer Lite Settings in your Drupal installation
    (/admin/config/system/symfony-mailer-lite)

  3. Configure the Microsoft Graph API transport:

    • Enter your Azure application credentials
    • Configure the sender email address
    • Test the connection

Usage of DSN string

Use the following DSN string format for Microsoft Graph API transport:

microsoft-graph-api://<client_id>:<client_secret>@<tenant_id>?from=<sender_email>

Features

  • Email sending through Microsoft Graph API
  • Support for Microsoft 365 authentication
  • Integration with Symfony Mailer Lite's email templating system
  • HTML email support
  • Email testing functionality

Troubleshooting

Common issues and their solutions:

  • Authentication Failures: Ensure your Azure application credentials are correct and the application has the
    necessary permissions.
  • Email Not Sending: Verify that the sender email address is properly configured and belongs to your Microsoft 365
    organization.
  • Permission Issues: Make sure the Microsoft Graph API permissions are properly configured and admin consent is
    granted if required.

Maintainers

Current maintainers:

License

This project is licensed under GPL v2 or later.

Drupal 10–11

Ask your assistant about Symfony Mailer Lite: Microsoft Graph API / oAuth2 Transport

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0 Stable 10–11 Feb 27, 2025
1.0.x-dev Dev 10–11 Feb 27, 2025