motze92/office365-mail
Composer 安装命令:
composer require motze92/office365-mail
包简介
Office365 transport for Laravel
README 文档
README
Mail driver for the Laravel framework 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. More informations here.
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
For Laravel 9 please use
{
"require": {
"motze92/office365-mail": "^3.0"
}
}
Laravel 8
For Laravel 8 please use
{
"require": {
"motze92/office365-mail": "^2.0"
}
}
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
To obtain needed config values use this instructions:
- Open the Azure Active Directory-Portal) with your Office365 Admin-User
- Open the Section Manage > App-Registrations
- Create a new App
- Within the App under
Manage>API-Permissions>Application Permissionsadd theMail.ReadWriteand theMail.Sendpermission (Microsoft Graph > Application Permissions > Mail > Mail.ReadWrite and Microsoft Graph > Application Permissions > Mail > Mail.Send) - After saving the permission apply the Admin-Permission for your organization
- In the Section Manage > Certificates and Secrets create a new Client Secret with Expiration = 24 months, this you need later for the
.env- VariableOFFICE365MAIL_CLIENT_SECRET
The Mail.ReadWrite Permission is needed when sending large attachments (>4MB).
.env - File
Laravel < 7
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 > 7
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 (https://github.com/laravel/laravel/blob/7.x/config/mail.php)
'office365mail' => [
'transport' => 'office365mail',
],
Credits
Moritz Mair, Matthias Radmüller, Merlin Mayr
Copyright and license
Copyright (c) Moritz Mair. All Rights Reserved. Licensed under the MIT license.
motze92/office365-mail 适用场景与选型建议
motze92/office365-mail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 305.54k 次下载、GitHub Stars 达 64, 最近一次更新时间为 2020 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 motze92/office365-mail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 motze92/office365-mail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 305.54k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 64
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-26