PHPackages                             adbros/nette-microsoft-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. adbros/nette-microsoft-mailer

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

adbros/nette-microsoft-mailer
=============================

v0.2(1y ago)02.0k↓44.7%MITPHPPHP &gt;=8.1

Since Sep 19Pushed 1y ago2 watchersCompare

[ Source](https://github.com/adbrosaci/nette-microsoft-mailer)[ Packagist](https://packagist.org/packages/adbros/nette-microsoft-mailer)[ RSS](/packages/adbros-nette-microsoft-mailer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Nette Microsoft Mailer
======================

[](#nette-microsoft-mailer)

This library provides e-mail sending via Microsoft Graph API.

---

[![main workflow](https://github.com/adbrosaci/nette-microsoft-mailer/actions/workflows/main.yml/badge.svg)](https://github.com/adbrosaci/nette-microsoft-mailer/actions/workflows/main.yml)[![Licence](https://camo.githubusercontent.com/78261c0a8d8b0bd018dc0c0b4bdd2728e67b0b25f51149899e0316f96572cdb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616462726f732f6e657474652d6d6963726f736f66742d6d61696c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/nette-microsoft-mailer)[![Downloads this Month](https://camo.githubusercontent.com/608463a5ed6f93577382aff7647cdcd70bff3e86e1a9cef696c3bb7f4234c7c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f616462726f732f6e657474652d6d6963726f736f66742d6d61696c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/nette-microsoft-mailer)[![Downloads total](https://camo.githubusercontent.com/599962c018ae426d96aa5ceebdba7c32aff5b28432847710f09f8fa21f271389/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616462726f732f6e657474652d6d6963726f736f66742d6d61696c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/nette-microsoft-mailer)[![Latest stable](https://camo.githubusercontent.com/72cf154e2a2ce8fb28b488a236b9020cde289b9d42daed9103416792e8dd9e4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616462726f732f6e657474652d6d6963726f736f66742d6d61696c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/nette-microsoft-mailer)

How to install
--------------

[](#how-to-install)

```
composer require adbros/nette-microsoft-mailer
```

Azure setup
-----------

[](#azure-setup)

### Register an application in Azure Portal

[](#register-an-application-in-azure-portal)

1. Go to [Azure Portal](https://portal.azure.com/)
2. Go to Microsoft Entra ID -&gt; App registrations
3. Click on "New registration"
4. Fill in the form:
    - Name: `Your app name`
    - Supported account types: `Accounts in this organizational directory only (Single tenant)`
    - Redirect URI: `http://localhost`
5. Save
    - Application (client) ID
    - Directory (tenant) ID
    - Client secret (create a new one in the "Certificates &amp; secrets" tab)

### API permissions

[](#api-permissions)

1. Go to API permissions
2. Click on "Add a permission"
3. Select "Microsoft Graph" =&gt; Application permissions
4. Select `Mail.Send`
5. Click on "Grant admin consent"

Register mailer
---------------

[](#register-mailer)

Just rewrite the default mailer service in your `neon` file.

```
services:
	mail.mailer: Adbros\MicrosoftMailer\MicrosoftMailer(
		tenantId: 'tenant_id'
		clientId: 'client_id'
		clientSecret: 'client_secret'
		defaultSender: 'default_sender_email'
	)
```

Usage
-----

[](#usage)

Use as standard Nette Mailer.

```
