multicraft 配置 smtp 发信 multicraft configure send email with smtp

multicraft默认使用的php函数发信,被很多邮件商当作垃圾信件给处理掉了。

Because default send mail method of  multicraft is php mail (),So our confirm and restpassword email always be treated as junk mail by the most of email services.

所以我们亟需配置一下SMTP发现。

So our immediate requirement is change our send mail method from PHP to SMTP.

首先你得有一个邮箱,QQ,网易,新浪啥的都行。记得开启SMTP功能!

Firstly you need a email :D,such like Google or any other else.Remember open the SMTP!

然后来到面板/protected/config/internal/application.php 编辑打开大约在第138行

that go to ~panel~/protected/config/internal/application.php and edit about at line 138.

'mail'=>array(
            'class'=>'ext.yii-mail.YiiMail',
            'logging'=>false,
                        'transportType'=>'php',

改成

        'mail'=>array(
            'class'=>'ext.yii-mail.YiiMail',
            'logging'=>true,
                        'transportType'=>'smtp',
                'transportOptions'=>array(
                'host'=>'smtp.qq.com',
                'username'=>'minet@mqq.com',
                'password'=>'qqqqq',
                'port'=>465,
                'encryption'=>'tls',
        ),

然后好像是PHP版本大于等于5.5的话

Some guys and me me a problem.if you php version is higher than 5.4

会显示

the rest password page would be shown:

Undefined property: Swift_Transport_StreamBuffer::$_sequence

那你就在

面板//protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/StreamBuffer.php中大约第163行

So you go to panel~/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/StreamBuffer.php

about at line 163

  public function readLine($sequence)
  {
    if (isset($this->_out) && !feof($this->_out))
    {
      $line = fgets($this->_out);
      return $line;
    }
  }
  private $_sequence;  //(加入这条)(insertraline)

If you feel this is helpful to you please leave a comment.thank~

看贴不回贴,立马就怀孕!

2 responses to “multicraft 配置 smtp 发信 multicraft configure send email with smtp

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据