gpt4 book ai didi

php - Yii2 密码重置不起作用

转载 作者:可可西里 更新时间:2023-11-01 11:45:16 27 4
gpt4 key购买 nike

我使用 Windows 和 Yii 2.0.13.1 以及 xampp 和 php7.1.4。登录时,我点击重置链接并输入我的电子邮件并发送,我遇到了这个错误:

Swift_TransportException
Process could not be started [The system cannot find the path specified. ]

我的 common/config/main-local.php 是:

'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,
],

其他设置和文件处于默认模式。问题是什么?请指导我

最佳答案

似乎在您的配置中缺少传输配置
例如:使用 gmail.com 作为传输(您应该选择主机可用的传输)

    'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'useFileTransport' => false,//set this property to false to send mails to real email addresses

'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => 'yourmail@gmail.com',
'password' => 'your_password',
'port' => '587',
'encryption' => 'tls',
'streamOptions' => [
'ssl' => [
'verify_peer' => false,
'allow_self_signed' => true
],
]
],

],

一切都在当下

关于php - Yii2 密码重置不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47477525/

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