今天,在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);
}
转载于:https://www.cnblogs.com/zhiqixue/archive/2012/11/13/2768121.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/180619.html原文链接:https://javaforall.cn