MAIL_MAILER=log
MAIL_DRIVER=smtp
MAIL_HOST=smtpdm.aliyun.com #stmp.qq.com
MAIL_PORT=465
MAIL_USERNAME=hui@xwtool.top #qq邮箱就123456789@qq.com
MAIL_PASSWORD=123456 #qq邮箱里获取的密码
MAIL_ENCRYPTION=ssl
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtpdm.aliyun.com'),
'port' => env('MAIL_PORT', 465),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', env('MAIL_USERNAME')),
'name' => env('MAIL_FROM_NAME', ''),
],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
public function build()
{
return $this->from('example@example.com')
->view('emails.orders.shipped');
}
按照laravel 文档搭建好后发现这个错误 不管怎么设置都还是出现问题出在这里
public function build()
{
return $this->view('emails.orders.shipped');
}
去掉这个from就行了