yii2 无法发送邮件的解决 can not send email


1.我在/common/config/main.php中,配置了mailer

'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
			'viewPath' => '@myapp/frontend/mail',
			
			'transport' => [
				'class' => 'Swift_SmtpTransport',
				'host' => 'smtp.sendgrid.net',
			
				'username' => '[email protected]',
				'password' => 'xxx',
				'port' => '587',
				'encryption' => 'tls',
			],
        ],


发现怎么弄也不好用,疯掉的感觉,

最后发现在文件里  /common/config/main-local 默认有一个mailer 的配置,把这个去掉就OK了。FUCK!

你可能感兴趣的:(yii2 无法发送邮件的解决 can not send email)