
脱离 laravel,使用 illuminatemail 发送邮件
在脱离 laravel 的情况下,可以使用其 mail 组件来发送邮件,方法如下:
use symfony\component\mailer\transport;
use symfony\component\mailer\mailer;
use symfony\component\mime\email;
$transport = transport::fromdsn('smtp://smtp服务器');
$mailer = new mailer($transport);
$email = (new email())
->from('xx@x.com')
->to('xx@xxxxx.com')
->subject('test')
->text('test')
->html('test');
$mailer->send($email);$mailer = new n\Illuminate\Mail\Mailer('default', new \Illuminate\Contracts\View(选个engine, 选个finder, new laravel的事件管理器), new Symfony的transport, new laravel的事件管理器);
$mailer-> 此时跟着 laravel 文档就行了。以上就是脱离Laravel框架,如何使用IlluminateMail发送邮件?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号