gpt4 book ai didi

linux - 无法从测试网站 yii2 swiftmailer 发送邮件

转载 作者:太空宇宙 更新时间:2023-11-04 05:14:04 24 4
gpt4 key购买 nike

我的服务器是基于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' => 'your.username@gmail.com',
'password' => 'yourpassword',
'port' => '587',
'encryption' => 'tls',
],

关于linux - 无法从测试网站 yii2 swiftmailer 发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51646360/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com