Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

symfony_mailer_office365

115 sites No security coverage
View on drupal.org

Symfony Mailer Office365 Integration

Why?

Office365 stops support for sending via SMTP with Basic Auth information (Username & Password).

A modern OAuth Flow is required. Since there is no feasable Drupal solution as of writing, this module provides a gap until there is an implementation provided by Symfony itself or a different solution.

How-To

1. Register your app with Microsoft Entra and provide Redirect URL: `https://example.com/office365/oauth/callback`
2. Configure with given credentials
`admin/config/system/mailer/office365`
3. Add "Office 365 - OAuth" Transport to your mailing policy
4. Login to save OAuth State with Drupal (Link available here: `admin/config/system/mailer/office365`)

Refreshing the token state

Using OAuth requires you to keep refreshing the access token with the given refresh token once it expired.
This module provides two ways to do that.

a) Drupal Cron

Refreshing (if necessary) happens when the Drupal Cron is run.
In that case make sure it gets run at least every 12 hours to be on the safe side.

See Token Lifetime: https://learn.microsoft.com/en-us/entra/identity-platform/refresh-tokens...

b) Drush Command

If you want to refresh the token (if necessary) in an own interval separate to the cron you can run the following drush command:

drush office365:refresh

Please choose an appropriate interval for this method as well.

Troubleshooting

You should check the status page `admin/config/system/mailer/office365` and check the system logs (watchdog f.e) for any error messages.

Credits

This was insipired by the following gists

Even though a lot has been rewritten, this inspired a lot how this concept was implemented. Thanks!

Please also see https://github.com/symfony/symfony/pull/52585 for development with symfony, which would make this module probably obsolete.

Activity

Total releases
4
First release
Apr 2025
Latest release
7 months ago
Release cadence
53 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-alpha4 Pre-release Sep 17, 2025
1.0.0-alpha3 Pre-release Apr 30, 2025
1.0.0-alpha2 Pre-release Apr 11, 2025
1.0.0-alpha1 Pre-release Apr 11, 2025