zoukankan      html  css  js  c++  java
  • 【phpmailer】类Could not instantiate mail function / IXWebHosting空间

    今天,在IXWebHost 上用 phpmailer类 发送邮件,源代码是从我的justhost空间直接copy过来的,但在IXWebHost空间上,出现Could not instantiate mail function错误,后来发现时发现邮件头部的问题,还有发现的内容也有点不对...

    之后修改 :

    class.phpmailer.php

    1. public function Send() 函数中,大约572-579行

                // Choose the mailer and send through it
                switch($this->Mailer) {
                    case 'sendmail':
                        return $this->SendmailSend($header, $body);
                    case 'smtp':
                        return $this->SmtpSend($header, $body);
                    default:
                        return $this->MailSend($header, $this->Body);  //这行 by 111 ,处理发送邮件内错不正确的问题
                }

    2.    protected function MailSend 函数 中,大约 676-684行

    else {
                    
                    //by zhiqi 111 edit : ixwebhost 空间走的是这步
                    $headers = substr($header,0,strpos($header,'Message-ID'));  //重新 处理头文件
                    $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)),$body,$headers); //修改头文件变量
                    //implement call back function if it exists
                    $isSent = ($rt == 1) ? 1 : 0;
                    $this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body);
                }
  • 相关阅读:
    lostash 正则
    Mysql 利用multiline 实现多行匹配
    java中byte, int的转换
    mysql perl 抓取update语句
    $/ 改变换行符
    mysql 匹配update
    perl binlog dml操作报告
    mysql 分区 按 PARTITION BY RANGE (TO_DAYS(startTime))
    Mysql explain 查看分区表
    写作的力道——北漂18年(番外篇一)
  • 原文地址:https://www.cnblogs.com/zhiqixue/p/2768121.html
Copyright © 2011-2022 走看看