Php Yii2密码重置不起作用
我在php7.1.4中使用Windows和Yii 2.0.13.1以及xampp。 登录时,我单击“重置it”链接,输入电子邮件并发送,我遇到以下错误: Swift_运输异常Php Yii2密码重置不起作用,php,windows,yii2,yii2-advanced-app,swiftmailer,Php,Windows,Yii2,Yii2 Advanced App,Swiftmailer,我在php7.1.4中使用Windows和Yii 2.0.13.1以及xampp。 登录时,我单击“重置it”链接,输入电子邮件并发送,我遇到以下错误: Swift_运输异常 无法启动进程[系统找不到指定的路径。 ] 我的common/config/main-local.php是: 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => '@common/mail',
无法启动进程[系统找不到指定的路径。 ] 我的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作为传输工具(你应该选择适用于你的主机的trasport)
现在一切正常我添加了此代码,结果是出现以下错误:stream\u socket\u enable\u crypto():SSL操作失败,代码为1。OpenSSL错误消息:错误:14090086:SSL例程:ssl3\u获取\u服务器\u证书:证书验证失败当您没有以前的错误时,因此建议您为有效的邮件服务器配置传输。。smtp.gmail.com只是一个建议。我正在本地主机上测试,我忘了说在本地主机上你可以使用有效的gmail.com电子邮件地址,…我在本地主机上也可以使用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
],
]
],
],