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);
                }
  • 相关阅读:
    CS224N Assignment 1扩展阅读——词嵌入
    算法面经总结
    Leetcode刷题笔记(一)
    使用python-Statsmodels进行基于统计学的时间序列分析
    chinaunix book
    行政区划分
    视频网站
    sqlserver还原bak备份文件
    linux给终端设置代理
    ruby中exec,system,%x的区别
  • 原文地址:https://www.cnblogs.com/zhiqixue/p/2768121.html
Copyright © 2011-2022 走看看