简体   繁体   中英

Yii 1 command doesn't work with Yii mailer or simple PHP mail

Yii 1 console command doesn't work with Yii mailer or simple PHP mail. I'm working on windows, but all is well when I go to frontend and test YiiMailer there.

My first answer was for yii2 sorry. It will be a pathing issue, it is a known bug with console apps in yii1 mail. See the below:

Note

In console apps, alias 'webroot' may not be the same as in web apps. See this yii issue . Best workaround is to set alias you need directly in config/console.php, eg:

Yii::setPathOfAlias('webroot.images.mail', '/path/to/your/images/mail/dir');

Yet another solution is to override protected/yiic.php and set 'webroot' alias there (see example files).

Taken from this page .

Other then that you might need to supply some additional code for me to delve deeper.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM