webguosai/hyperf-mailer
Composer 安装命令:
composer require webguosai/hyperf-mailer
包简介
hyperf邮箱扩展包
README 文档
README
简介
这个库只做smtp发送
运行环境
- php >= 8.1
- composer
- hyperf >= 3.1
安装
composer require webguosai/hyperf-mailer -vvv
配置
发布配置
php bin/hyperf.php vendor:publish webguosai/hyperf-mailer
配置文件
use function Hyperf\Support\env; return [ 'host' => env('MAIL_HOST', 'smtp.exmail.qq.com'), 'port' => env('MAIL_PORT', 465), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 'name' => env('MAIL_FROM_NAME', 'Example'), ], ];
使用
发送邮件
try { mailer()->send(string $toMail, string $subject, string $body, array $attachments, bool $isHtml); } catch (\PHPMailer\PHPMailer\Exception $e) { var_dump($e->getMessage()); }
Facade 发送
use Webguosai\HyperfSms\Facade; Mailer::send(string $toMail, string $subject, string $body, array $attachments, bool $isHtml);
文档
https://github.com/PHPMailer/PHPMailer?tab=readme-ov-file#a-simple-example
License
MIT
统计信息
- 总下载量: 188
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-11