kevinzheng/laravel-switchable-mail
Composer 安装命令:
composer require kevinzheng/laravel-switchable-mail
包简介
For Laravel to support multiple and switchable on runtime mail drivers.
README 文档
README
It makes Laravel be able to maintain multiple mail drivers at the same time, and be able to send to different mail addresses with specified mail drivers as configured at runtime automatically.
Instructions
Installation
-
Install this package using the Composer manager:
composer require kevinzheng/laravel-switchable-mail
-
Replace
Illuminate\Mail\MailServiceProvider::classwithKVZ\Laravel\SwitchableMail\MailServiceProvider::classin theconfig/app.phpfile. -
Publish configuration file:
php artisan vendor:publish --tag=switchable-mail
Configuration
It uses the MAIL_DRIVER configured in .env as the default mail driver, for those addresses you want to send to with specified mail drivers, configure it at switchable-mail.php.
You should install the mail drivers not provided by Laravel at the meantime, such as Aliyun Direct Mail and SendCloud:
```php
// 'directmail' => [
// 'qq.com', '163.com', '126.com', 'sina.com', 'sina.com.cn', 'sohu.com',
// ],
// 'mailgun' => [
// 'example.com',
// ],
```
Two mail drivers are available:
Usage
Nothing needs to be done, just use Laravel Mail as usual.
Thanks to
统计信息
- 总下载量: 4.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-23