PHPmailer 版本: 2.0.4
运行以下行时
$Mail = new PHPMailer();
$Mail->IsSMTP();
$Mail->AddAddress("first@mail.com");
$Mail->AddCC("second@mail.com");
... set some body, set host, set sender info, and so on
$Mail->send();
第一个和第二个地址都会收到邮件,但第二个地址不会作为抄送出现在邮件中,就像它是密件抄送而不是抄送一样。
当使用默认的"邮件"模式注释掉 IsSMTP() => 时,CC 将按预期显示。
试图谷歌这个效果,但似乎我是地球上唯一经历过这个问题的人......
地址未出现在邮件中
由于缺乏已发送邮件的原始标头等数据,您的问题几乎无法理解。我会在评论中要求这个,但我认为这对你来说毫无意义,因为......
PHPmailer版本:2.0.4
我在 PHPMailer 的更改日志中几乎看不到 2.0.4 版,但假设它发布在 2.0.0 rc2
和2.1.0 beta1
发布之间,这仍然意味着您使用的是 2007 年 12 月左右发布的代码
看在上帝的份上升级!
可能已经找到了解决方案:
PHPMailer Class, function CreateHeader(), line 890
原始代码:
if((($this->Mailer == 'sendmail') ||($this->邮件 == '邮件'))&& (count($this->cc)> 0)) { $result .= $this->AddrAppend('Cc', $this->cc);}
我的新固定代码:
if((($this->Mailer == 'sendmail') ||($this->邮件 == '邮件') ||($this->邮件 == 'smtp'))&& (count($this->cc)> 0)) { $result .= $this->AddrAppend('Cc', $this->cc);}
最初,AddrAppend() 函数仅在模式设置为"sendmail"或"mail"时才调用,但对于"smtp"模式也需要调用它
不知道这种情况是PHPmailer工作人员的意图,还是只是一个需要修复的错误。