laradock 部署 larabbs 之后,smtp 如何配置?已经按说明修改过.env、甚至 config/mail.php。
首先尝试配置项目的.env:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mxhichina.com
MAIL_PORT=25
MAIL_USERNAME=name@domain
MAIL_PASSWORD=SECRET
MAIL_ENCRYPTION=
该配置是按阿里企业邮箱说明做的,larabbs跑起来之后,注册新用户,收不到邮件。
然后,尝试直接写入config/mail.php,没太理解sendmail和markdown:
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mxhichina.com'),
'port' => env('MAIL_PORT', 25),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'name@domain'),
'name' => env('MAIL_FROM_NAME', 'name@domain'),
],
'encryption' => env('MAIL_ENCRYPTION', ''),
'username' => env('MAIL_USERNAME', "name@domain"),
'password' => env('MAIL_PASSWORD', "SECRET"),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
又尝试按A帖配置了sendmail(这里其实有误区——下述);
发现没有该贴所说的mail命令;
又按B帖安装mail命令,还是没有mail命令。
至此,发现这是误区。。。sendmail是个服务?且不论docker容器中不推荐多个进程,也未见larabbs安装文档中提及任何sendmail配置。
决定停下来求助,免得在错误的道路上浪费时间。
推荐文章: