如何正确添加List-Unsubscribe标头?

我在LAMP堆栈上使用Postfix邮件服务器。 我使用phpmailer发送我的邮件。 我最近注意到主要的ISP已经添加了对“List-Unsubscribe”头的支持。 根据Hotmail,现场自动添加一个

你订阅了这个邮件列表。 退订

我在查看我的Facebook邮件时注意到了这一点。 所以当我查看Facebook标题时,我注意到了这一行

List-Unsubscribe: <mailto:[email protected]> X-Priority: 3 X-Mailer: ZuckMail [version 1.00] X-Facebook-Camp: engage_digest_email X-Facebook-Notify: engage_digest_email; mailid=523199eG1fe9e7abG0Gd4 List-Unsubscribe: <mailto:[email protected]> Errors-To: [email protected] X-FACEBOOK-PRIORITY: 1 

所以用我的phpmailer安装程序,我添加了addCustomHeader()函数。

 $x = new PHPMailer(); $x->From = "[email protected]"; $x->FromName = "Veepiz Support"; $x->AddAddress($o->emailaddress,$o->toname); $x->AddReplyTo("[email protected]", "Veepiz Support"); $x->WordWrap = 80; // set word wrap to 50 characters $x->IsHTML(true); // set email format to HTML $x->IsSMTP(); $x->Host = "veepiz.com"; $x->Username = '[email protected]'; $x->Password = 'xxxxxxxx'; $x->Subject = $o->subject; $x->Body = $o->content."\n\n<span style='color:white'>Forgotten your password? go to <a href='http://www.veepiz.com/forgot.php'>http://www.veepiz.com/forgot.php</a></span>"; $x->Body = str_replace("\r", "\n", wordwrap($x->Body,80)); $x->AltBody = $o->plain_text; $x->AltBody = str_replace("\r", "\n", wordwrap($x->AltBody,80)); $x->AddCustomHeader("List-Unsubscribe: <mailto:[email protected]?subject=Unsubscribe>, <http://www.veepiz.com/unsubscribe.php?unsubscribeid=$ox->id>"); 

现在,当我发送我的邮件,我在我的邮件标题中得到这个…

 List-Unsubscribe: <mailto:[email protected]?subject=Unsubscribe>,<http://www.veepiz.com/unsubscribe.php?unsubscribeid=1> 

看来phpmailer是添加这个头,它符合rfc http://www.list-unsubscribe.com/

但在Hotmail中,我没有得到显示我订阅了等待邮件列表取消订阅的组件

你订阅了这个邮件列表。 退订

所以你应该问问Hotmail。 他们可能只显示可信的通讯或发件人的组件。 谁告诉你,他们显示任何包含“List-Unsubscribe:”标题的邮件。

Phishers和Spammers可以使用这个标题来使邮件更加严肃。 Hotmail很可能只接受来自受信任站点的这些头文件。