我的服务器基于Linux。请为我提供正确的邮件程序配置
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'port' => '465',
'encryption' => 'ssl',
],
],
答案 0 :(得分:0)
对于gmail应该使用端口587
加密tls
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => 'your.username@gmail.com',
'password' => 'yourpassword',
'port' => '587',
'encryption' => 'tls',
],