PHPackages                             kashi326/office365-mail - 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. kashi326/office365-mail

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

kashi326/office365-mail
=======================

Office365 transport for Laravel

v1.0.0(1y ago)06MITPHPPHP ^7.1.3 || ^8

Since Oct 15Pushed 1y agoCompare

[ Source](https://github.com/kashi326/office365-mail)[ Packagist](https://packagist.org/packages/kashi326/office365-mail)[ RSS](/packages/kashi326-office365-mail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Laravel Microsoft Graph Mail driver - Mail Driver for Office365
===============================================================

[](#laravel-microsoft-graph-mail-driver---mail-driver-for-office365)

Mail driver for the [Laravel framework](https://laravel.com/) to send emails using Microsoft Graph without user authentication and SMTP. Only specify the E-Mail-Address in the FROM-Header of the E-Mail and this Office 365 Package will send the E-Mail trough the Microsoft Graph-Api and put the sent E-Mail in the sender's Mailbox sent folder.

**Key features:**

- Send E-Mails with the Microsoft Graph-Api instead of the SMTP driver
- Automatically puts the E-Mail in the Sent folder of the user in the From-Header
- One Application per Organization
- Supports multiple Domains
- Supports large file attachments
- Faster and Error-less than the Office-365 SMTP

To use this package you have to register your application [here](https://go.microsoft.com/fwlink/?linkid=2083908). More informations [here](https://docs.microsoft.com/en-us/graph/auth-register-app-v2).

Install the Package
-------------------

[](#install-the-package)

You can install the package with Composer, either run `composer require motze92/office365-mail`, or edit your `composer.json` file:

### Laravel 9

[](#laravel-9)

For Laravel 9 please use

```
{
  "require": {
    "motze92/office365-mail": "^3.0"
  }
}

```

### Laravel 8

[](#laravel-8)

For Laravel 8 please use

```
{
  "require": {
    "motze92/office365-mail": "^2.0"
  }
}

```

### Laravel &lt; 7

[](#laravel--7)

For Laravel 6 and earlier please use

```
{
  "require": {
    "motze92/office365-mail": "^1.0"
  }
}

```

To publish the config file use this command:

```
php  artisan  vendor:publish  --tag=office365mail
```

Configure
---------

[](#configure)

To obtain needed config values use this [instructions](https://docs.microsoft.com/en-us/graph/auth-v2-service):

- Open the [Azure Active Directory-Portal](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview)) with your Office365 Admin-User
- Open the Section Manage &gt; [App-Registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps)
- Create a new App
- Within the App under `Manage` &gt; `API-Permissions` &gt; `Application Permissions` add the `Mail.ReadWrite` and the `Mail.Send` permission (Microsoft Graph &gt; Application Permissions &gt; Mail &gt; Mail.ReadWrite and Microsoft Graph &gt; Application Permissions &gt; Mail &gt; Mail.Send)
- After saving the permission apply the Admin-Permission for your organization
- In the Section Manage &gt; Certificates and Secrets create a new Client Secret with Expiration = 24 months, this you need later for the `.env` - Variable `OFFICE365MAIL_CLIENT_SECRET`

The `Mail.ReadWrite` Permission is needed when sending large attachments (&gt;4MB).

#### .env - File

[](#env---file)

##### Laravel &lt; 7

[](#laravel--7-1)

```
MAIL_DRIVER=office365mail
OFFICE365MAIL_CLIENT_ID=YOUR-MS-GRAPH-CLIENT-ID
OFFICE365MAIL_TENANT=YOUR-MS-GRAPH-TENANT-ID
OFFICE365MAIL_CLIENT_SECRET=YOUR-MS-GRAPH-CLIENT-SECRET

```

##### Laravel &gt; 7

[](#laravel--7-2)

```
MAIL_MAILER=office365mail
OFFICE365MAIL_CLIENT_ID=YOUR-MS-GRAPH-CLIENT-ID
OFFICE365MAIL_TENANT=YOUR-MS-GRAPH-TENANT-ID
OFFICE365MAIL_CLIENT_SECRET=YOUR-MS-GRAPH-CLIENT-SECRET

```

### config/mail.php - add to mailer configuration array ()

[](#configmailphp---add-to-mailer-configuration-array-httpsgithubcomlaravellaravelblob7xconfigmailphp)

```
'office365mail' => [
            'transport' => 'office365mail',
      ],

```

Credits
-------

[](#credits)

[Moritz Mair](https://moritzmair.info/), [Matthias Radmüller](https://www.radmueller.net), [Merlin Mayr](https://indigit.gmbh)

Copyright and license
---------------------

[](#copyright-and-license)

Copyright (c) Moritz Mair. All Rights Reserved. Licensed under the MIT [license](LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

573d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00abe8becb514c071a9db19d6acd9c31f2502aecf5ca3fb5494f571a42f49b33?d=identicon)[kashi326](/maintainers/kashi326)

---

Top Contributors

[![matrad](https://avatars.githubusercontent.com/u/660903?v=4)](https://github.com/matrad "matrad (17 commits)")[![motze92](https://avatars.githubusercontent.com/u/41009610?v=4)](https://github.com/motze92 "motze92 (11 commits)")[![mmerm](https://avatars.githubusercontent.com/u/26694162?v=4)](https://github.com/mmerm "mmerm (7 commits)")[![lewis-munyi](https://avatars.githubusercontent.com/u/15906323?v=4)](https://github.com/lewis-munyi "lewis-munyi (4 commits)")[![kashi326](https://avatars.githubusercontent.com/u/57842881?v=4)](https://github.com/kashi326 "kashi326 (3 commits)")[![EndOfSource](https://avatars.githubusercontent.com/u/5971157?v=4)](https://github.com/EndOfSource "EndOfSource (1 commits)")[![matthewscalf](https://avatars.githubusercontent.com/u/4260215?v=4)](https://github.com/matthewscalf "matthewscalf (1 commits)")

### Embed Badge

![Health badge](/badges/kashi326-office365-mail/health.svg)

```
[![Health](https://phpackages.com/badges/kashi326-office365-mail/health.svg)](https://phpackages.com/packages/kashi326-office365-mail)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[motze92/office365-mail

Office365 transport for Laravel

65274.3k](/packages/motze92-office365-mail)[netflie/laravel-notification-whatsapp

Laravel notification driver for WhatsApp

176173.9k](/packages/netflie-laravel-notification-whatsapp)

PHPackages © 2026

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