我的服务器是基于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',
],
],
对于gmail应该是端口587
加密tls
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => '[email protected]',
'password' => 'yourpassword',
'port' => '587',
'encryption' => 'tls',
],