有没有办法使用PHPMailer更改返回路径
我做了以下,但没有奏效
$mail->AddCustomHeader('Return-path:test@email.co.za');
Run Code Online (Sandbox Code Playgroud)
我正在使用以下语句发送邮件
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
//Building the reporting email to report on all the mails send
echo "Message REPORT sent!\n";
}
Run Code Online (Sandbox Code Playgroud)
我收到了电子邮件,但返回路径没有变化?
设置返回路径的正确方法(截至2013年7月)是使用:
$mail->ReturnPath='bounce_here@domain.com';
Run Code Online (Sandbox Code Playgroud)
phpmailer源码包含以下内容,这就是我认为$ mail-> Sender工作的原因
if ($this->ReturnPath) {
$result .= $this->HeaderLine('Return-Path', '<'.trim($this->ReturnPath).'>');
} elseif ($this->Sender == '') {
$result .= $this->HeaderLine('Return-Path', '<'.trim($this->From).'>');
} else {
$result .= $this->HeaderLine('Return-Path', '<'.trim($this->Sender).'>');
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
24395 次 |
| 最近记录: |