简体   繁体   English

Yii 1命令不适用于Yii邮件程序或简单的PHP邮件

[英]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. Yii 1控制台命令不适用于Yii邮件程序或简单的PHP邮件。 I'm working on windows, but all is well when I go to frontend and test YiiMailer there. 我正在Windows上工作,但是当我去前端并在那里测试YiiMailer时一切都很好。

My first answer was for yii2 sorry. 我的第一个答案是对不起。 It will be a pathing issue, it is a known bug with console apps in yii1 mail. 这将是一个路径问题,这是yii1邮件中控制台应用程序的已知错误。 See the below: 见下面:

Note 注意

In console apps, alias 'webroot' may not be the same as in web apps. 在控制台应用程序中,别名“ webroot”可能与Web应用程序中的别名不同。 See this yii issue . 请参阅此yii问题 Best workaround is to set alias you need directly in config/console.php, eg: 最好的解决方法是直接在config / console.php中设置所需的别名,例如:

Yii::setPathOfAlias('webroot.images.mail', '/path/to/your/images/mail/dir'); 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). 另一个解决方案是覆盖protected / yiic.php并在此处设置“ webroot”别名(请参见示例文件)。

Taken from this page . 取自此页面

Other then that you might need to supply some additional code for me to delve deeper. 除此之外,您可能需要提供一些其他代码以供我深入研究。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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