overtrue / laravel-mail-aliyun
Aliyun DrirectMail Transport for Laravel Application.
Fund package maintenance!
overtrue
Installs: 8 821
Dependents: 0
Suggesters: 0
Security: 0
Stars: 71
Watchers: 4
Forks: 7
Open Issues: 2
Requires
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ^9.0|^10.0|^11.0
- swiftmailer/swiftmailer: ^6.1
Requires (Dev)
- laravel/pint: ^1.5
README
📧 Aliyun DrirectMail Transport for Laravel Application.
Installing
$ composer require overtrue/laravel-mail-aliyun -vvv
Configuration
API documention: https://help.aliyun.com/document_detail/29435.html
config/services.php
'directmail' => [ 'key' => env('ALIYUN_ACCESS_KEY_ID'), 'secret' => env('ALIYUN_ACCESS_KEY_SECRET'), 'region_id' => env('ALIYUN_REGION_ID'), 'from_address' => env('ALIYUN_FROM_ADDRESS'), 'from_alias' => env('ALIYUN_FROM_ALIAS'), ],
AccessKeyID 和 AccessKeySecret 由阿里云官方颁发给用户的 AccessKey 信息(可以通过阿里云控制台用户信息管理中查看和管理).
Usage
Set default mail driver and configuration:
.env
MAIL_DRIVER=directmail ALIYUN_ACCESS_KEY_ID= #AccessKeyID ALIYUN_ACCESS_KEY_SECRET= #AccessKeySecret ALIYUN_REGION_ID= #RegionID: cn-hangzhou, ap-southeast-1, ap-southeast-2 ALIYUN_FROM_ADDRESS= #FromAddress ALIYUN_FROM_ALIAS= #FromAlias
TagName
use Overtrue\LaravelMailAliyun\HasTagName; class VerifyMail extend Mailable{ use HasTagName; public function build() { $this->tagName('alreadyDefinedTag'); return $this->text('mails.verify'); } }
Please reference the official doc: Laravel Sending mail
❤️ Sponsor me
如果你喜欢我的项目并想支持它,点击这里 ❤️
Project supported by JetBrains
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
PHP 扩展包开发
想知道如何从零开始构建 PHP 扩展包?
请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》
License
MIT