【问题标题】:Unable to send mail with yiiyii无法发送邮件
【发布时间】:2014-01-01 09:54:05
【问题描述】:

我目前正在做一个项目。一切都在我的本地主机上运行良好。但是当我把它放到网上时,然后注册后,它会在邮件发送中引发错误。错误如下:

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文件夹?
  • 在扩展文件夹,yii-mail
  • swiftMalier 文件夹直接添加扩展然后试试。希望对你有帮助

标签: php email yii swiftmailer


【解决方案1】:

嗯, swiftMailer 应该在“protected/vendors”文件夹中(好的做法)。

然后在 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');
}

一切都应该很好。

顺便说一句,我使用 https://code.google.com/p/yii-mail/ 和新的 http://swiftmailer.org/

【讨论】:

  • 那不是路径的问题,其实我上传系统的时候上传器有问题,所以有些文件不能上传,但是+1表示好评...跨度>
猜你喜欢
  • 2015-07-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-07
相关资源
最近更新 更多