This project is not covered by Drupal’s security advisory policy.

There is an open security issue: Add support for the Key module: better support for sensitive connection data

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.

Supporting organizations: 
Development
Funding

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Integrations
  • chart icon87 sites report using this module
  • Created by ayalon on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases