先上我的配置项'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => '@common/mail', 'useFileTransport' => true, 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.163.com', 'username' => 'username@163.com', 'password' => 'myPassword', 'port' => '994', 'encryption' => 'ssl', ], ],然后上我的发送代码return \Yii::$app->mailer->compose('passwordResetToken', ['user' => $user])
->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name . ' robot'])
->setTo($this->email)
->setSubject('Password reset for ' . \Yii::$app->name)
->send();怎么测试都无效,是不是我姿势不对?!
- 2 回答
- 0 关注
- 1527 浏览
添加回答
举报
0/150
提交
取消