我正在使用 PHPMailer 从我的网站向在我的网站上注册的会员发送 html 电子邮件。
我正在使用以下代码添加 List Unsubscribe 标头。www.test-mailer.com
但是当我用or测试发送的电子邮件时www.unspam.email
,我收到了错误
Your email is missing the List-Unsubscribe header.
我已经在 gmail 中检查了带有 show original 选项的电子邮件,它显示的列表取消订阅如下:
Message-ID: <0e48dxxxxxxxxxxxx9e08f@www.mywebsitedomain.in>
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
Disposition-Notification-To: <info@mywebsitedomain.in>
List-Unsubscribe: <mailto:unsubscribe@mywebsitedomain.in?subject=unsubscribe>,
<https://www.mywebsitedomain.in/unsubscribe.php>
X-Confirm-Reading-To: info@mywebsitedomain.in
MIME-Version: 1.0
代码发送电子邮件是:
<?php
// constant are defined in another php file.... and its working ok....
$mail->AddCustomHeader("List-Unsubscribe : <mailto:unsubscribe@mywebsitedomain.in?subject=unsubscribe>, <".$file_full_path_base."unsubscribe.php>");
$mail->AddReplyTo(constant('FROMEMAIL'), constant('FROMNAME'));
$mail->AddCustomHeader( "X-Confirm-Reading-To:".constant('FROMEMAIL')."" );
$mail->ConfirmReadingTo = constant('FROMEMAIL');
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
$mail->SetFrom(constant('FROMEMAIL'), constant('FROMNAME'));
?>
我搜索了列表取消订阅,并获得了为列表取消订阅添加自定义标题的解决方案。我正在使用它,但直到出现错误 - Your email is missing the List-Unsubscribe header.
帮助表示赞赏。