View not Found – yii\base\ViewNotFoundException The view file does not exist: F:\wamp\www\frontend/mail\passwordResetToken-html.php
修改common/config/main-local.php 在’components’ => []中配置 mailer中添加
"viewPath" =>"@common/mail",即可
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' =>false,//这句一定有,false发送邮件,true只是生成邮件在runtime文件夹下,不发邮件
"viewPath" =>"@common/mail",
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.163.com', //每种邮箱的host配置不一样
'username' => '' ,
'password' => '', //邮箱是授权码,不是登录密码
'port' => '25',
'encryption' => 'tls',
],
'messageConfig'=>[
'charset'=>'UTF-8',
'from'=>['d@163.com'=>'文'] // 发件人名称
],
],