1.我在/common/config/main.php中,配置了mailer
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@myapp/frontend/mail',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.sendgrid.net',
'username' => 'support@xxxx.com',
'password' => 'xxx',
'port' => '587',
'encryption' => 'tls',
],
],
发现怎么弄也不好用,疯掉的感觉,
最后发现在文件里 /common/config/main-local 默认有一个mailer 的配置,把这个去掉就OK了。FUCK!