PHPackages                             oliverkroener/ok-exchange365-mailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. oliverkroener/ok-exchange365-mailer

ActiveTypo3-cms-extension[Mail &amp; Notifications](/categories/mail)

oliverkroener/ok-exchange365-mailer
===================================

A TYPO3 extension for sending emails using Exchange 365 and Microsoft Graph API

4.2.0(1mo ago)916.9k↓34.5%2GPL-2.0-or-laterPHPPHP &gt;=8.1.0 &lt;8.6.0

Since Sep 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/oliverkroener/ok_exchange365_mailer)[ Packagist](https://packagist.org/packages/oliverkroener/ok-exchange365-mailer)[ Docs](https://www.oliver-kroener.de)[ RSS](/packages/oliverkroener-ok-exchange365-mailer/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (9)Versions (30)Used By (0)

Microsoft Exchange 365 Mailer (ok\_exchange365\_mailer)
=======================================================

[](#microsoft-exchange-365-mailer-ok_exchange365_mailer)

[![TYPO3 12](https://camo.githubusercontent.com/2684d7b10857a7fbe915ab7d09d7f77e12dd4ad82d59d74d33de17e09c6939a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31322d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/12)[![TYPO3 13](https://camo.githubusercontent.com/dd8defc1bd50d5ea9806215644f9b57c5c16a94a7dd0fc400d4b9ff87e3a7874/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31332d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/13)[![TYPO3 14](https://camo.githubusercontent.com/e529124be6a5d4fa54f1e7947268a827ebb324837ad7d64b2eaf2dea68a14b83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31342d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/14)[![PHP 8.1+](https://camo.githubusercontent.com/3e41095f4ad1c6ad78f988bd1c107f87972f334143c3ba814165a03e1f43a63c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![License: GPL v2+](https://camo.githubusercontent.com/6453309dcfa061355d200754f7c0067d22bebd9d9c754ce6b9216176e797e8ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076322532422d626c7565)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)[![Version](https://camo.githubusercontent.com/d1cf0a7ca438be8a94ea467da369a7f92ef0024cdd273daebb24b48a3326f010/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d342e322e302d677265656e)](https://github.com/oliverkroener/ok_exchange365_mailer)

A TYPO3 extension for sending emails via Microsoft Exchange 365 using the MS Graph API instead of SMTP. Uses OAuth 2.0 client credentials flow for secure, token-based authentication.

Features
--------

[](#features)

- Send emails through Microsoft Graph API — no SMTP required
- OAuth 2.0 client credentials flow for server-to-server authentication
- Supports both backend (environment variables / TYPO3 settings) and frontend (TypoScript) configuration
- Compatible with Powermail, TYPO3 Form Framework, and other form extensions
- Optional saving of sent emails to the sender's "Sent Items" folder
- Automatic credential blinding in TYPO3's configuration module
- Works with shared mailboxes and Application Access Policies
- **Send As / Send On Behalf** — optional `graphSenderUserId` decouples the Graph mailbox used for `/users/{id}/sendMail` from the visible `From`header, so a configured mailbox can send on behalf of another

Requirements
------------

[](#requirements)

- **TYPO3**: 12.4 LTS, 13.4 LTS, or 14.x
- **PHP**: 8.1 – 8.5
- **Dependencies**:
    - `microsoft/microsoft-graph` ^2
    - `oliverkroener/ok-typo3-helper` ^3

Installation
------------

[](#installation)

Install via Composer (recommended):

```
composer require oliverkroener/ok-exchange365-mailer
```

### Local path repository

[](#local-path-repository)

If using a local path (e.g., in a monorepo), add the repository to your root `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/ok_exchange365_mailer"
        }
    ]
}
```

Then install:

```
composer require oliverkroener/ok-exchange365-mailer:@dev
```

Configuration
-------------

[](#configuration)

### 1. Register an Azure App

[](#1-register-an-azure-app)

Register an application in Microsoft Entra ID (formerly Azure AD) with `Mail.Send` and `User.ReadBasic.All` application permissions. Grant admin consent. See the [full Azure setup guide](Documentation/Azure.rst).

### 2. Configure TYPO3

[](#2-configure-typo3)

Set the mail transport to `Exchange365Transport` and provide your Azure credentials.

**Via environment variables (.env):**

VariableDescription`TYPO3_CONF_VARS__MAIL__transport``OliverKroener\OkExchange365\Mail\Transport\Exchange365Transport``TYPO3_CONF_VARS__MAIL__transport_exchange365_tenantId`Microsoft Entra ID Tenant ID`TYPO3_CONF_VARS__MAIL__transport_exchange365_clientId`Azure Application (Client) ID`TYPO3_CONF_VARS__MAIL__transport_exchange365_clientSecret`Azure Application Secret Value`TYPO3_CONF_VARS__MAIL__transport_exchange365_fromEmail`Sender email address (must exist in Exchange 365)`TYPO3_CONF_VARS__MAIL__transport_exchange365_graphSenderUserId`*(optional)* Graph mailbox/user ID used for `/users/{id}/sendMail`. When set, this mailbox sends the message; the visible `From` header still comes from the message or `fromEmail`. Use for *Send As* / *Send On Behalf*.`TYPO3_CONF_VARS__MAIL__transport_exchange365_saveToSentItems``1` to save to Sent Items, `0` to skip (default: `0`)**Via TypoScript (for frontend forms):**

```
plugin.tx_okexchange365mailer.settings.exchange365 {
    tenantId = your-tenant-id
    clientId = your-client-id
    clientSecret = your-client-secret
    fromEmail = service@your-domain.com
    # Optional: route via a different mailbox using Send As / Send On Behalf
    # graphSenderUserId = service@your-domain.com
    saveToSentItems = 1
}

```

### Send As / Send On Behalf

[](#send-as--send-on-behalf)

The optional `graphSenderUserId` (or `transport_exchange365_graphSenderUserId`) decouples the **Graph mailbox** used for the API call from the **visible `From` address** of the message:

- The Graph endpoint `/users/{id}/sendMail` is called against `graphSenderUserId`.
- The message `From` header still resolves through `$graphMessage['from']` → `fromEmail` → `defaultMailFromAddress`, so recipients see the configured sender, not the Graph mailbox.

The configured Graph mailbox must hold *Send As* or *Send On Behalf*permission on the visible sender mailbox in Exchange. See the [Microsoft Graph documentation on sending mail from another user](https://learn.microsoft.com/en-us/graph/outlook-send-mail-from-other-user).

When `graphSenderUserId` is unset (or empty), the same value resolution chain is used to pick the Graph mailbox — i.e. the visible sender also sends the message, which is the standard single-mailbox setup.

### Sender Display Name

[](#sender-display-name)

The Graph API uses the **Display name** configured on the mailbox in Exchange Online. TYPO3's `defaultMailFromName` has no effect. Configure the display name in the Microsoft 365 Admin Center or Exchange Admin Center.

Architecture
------------

[](#architecture)

ComponentDescription`Exchange365Transport`Custom Symfony mailer transport; handles OAuth2 auth and sends via Graph API`ModifyBlindedConfigurationOptionsEventListener`PSR-14 event listener; blinds credentials in TYPO3 configuration module`MSGraphMailApiService` (from ok-typo3-helper)Converts Symfony email messages to Microsoft Graph format```
Classes/
├── Mail/Transport/
│   └── Exchange365Transport.php
└── Lowlevel/EventListener/
    └── ModifyBlindedConfigurationOptionsEventListener.php
Configuration/
├── Services.yaml
├── TCA/Overrides/sys_template.php
└── TypoScript/
    ├── constants.typoscript
    └── setup.typoscript

```

License
-------

[](#license)

GPL-2.0-or-later

Author — Oliver Kroener
-----------------------

[](#author--oliver-kroener)

### Automated. Scaled. Done.

[](#automated-scaled-done)

Web3 · Cloud · Automation

Technology is only valuable when it solves a real problem. For over 30 years I've been translating between business and tech — so your investment in digitalisation doesn't stall at proof-of-concept but delivers measurable results.

- Website: [oliver-kroener.de](https://www.oliver-kroener.de)
- Web3: [web3.oliver-kroener.de](https://web3.oliver-kroener.de/)
- Email:
- Web3 Email:

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance92

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 96% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~19 days

Total

24

Last Release

32d ago

Major Versions

2.0.0 → 3.0.02024-09-20

1.0.2 → 2.0.12024-10-23

2.0.1 → 3.0.22024-11-14

1.0.3 → 4.0.02025-04-03

2.0.5 → 4.0.32025-07-29

PHP version history (2 changes)2.0.0PHP &gt;=7.2

4.2.0PHP &gt;=8.1.0 &lt;8.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e3131f46d9c0fc7766936f374848d0ab6be6f8095f2f2c01984736a5e7fcd52?d=identicon)[Oliver Kroener](/maintainers/Oliver%20Kroener)

---

Top Contributors

[![oliverkroener](https://avatars.githubusercontent.com/u/4545439?v=4)](https://github.com/oliverkroener "oliverkroener (48 commits)")[![mgerdes-atl](https://avatars.githubusercontent.com/u/107911221?v=4)](https://github.com/mgerdes-atl "mgerdes-atl (2 commits)")

---

Tags

emailmaileroauth2typo3typo3-extensionMicrosoft graphoffice-365exchange-365smtp-replacement

### Embed Badge

![Health badge](/badges/oliverkroener-ok-exchange365-mailer/health.svg)

```
[![Health](https://phpackages.com/badges/oliverkroener-ok-exchange365-mailer/health.svg)](https://phpackages.com/packages/oliverkroener-ok-exchange365-mailer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
