[英]Unable to send mail with yii
我目前正在做一個項目。 在我的本地主機上一切正常。 但是,當我將其聯機時,然后在注冊后,它將在郵件發送中引發錯誤。 錯誤是:
include(Swift_Mime_ContentEncoder_QpContentEncoder.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory
這個項目在yii中,並且已經完成了所有配置。 該網站位於
http://eexamhall.com/apps/index.php/users/index
問題出在注冊時發送郵件。 我該如何解決?
嗯,swiftMailer應該放在“受保護的/供應商”文件夾中(習慣做法)。
然后在YiiMail.php中更改路徑:
public function registerScripts() {
if (self::$registeredScripts) {
return;
}
self::$registeredScripts = true;
require(Yii::app()->basePath . '/vendors/swiftMailer/classes/Swift.php');
Yii::registerAutoloader(array('Swift', 'autoload'));
require(Yii::app()->basePath . '/vendors/swiftMailer/swift_init.php');
}
而且一切都應該很好。
順便說一句,我在新的http://swiftmailer.org/中使用https://code.google.com/p/yii-mail/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.