我在LAMP堆栈上使用Postfix邮件服务器.我使用PHPmailer发送邮件.我最近注意到主要的ISP已经添加了对“List-Unsubscribe”标题的支持.根据Hotmail,live自动添加一个
原文链接:https://www.f2er.com/php/138918.htmlYou’re subscribed to this mailing list. Unsubscribe
检查我的Facebook邮件时我注意到了这一点.所以当我检查Facebook标题时,我注意到了这一行
List-Unsubscribe: <mailto:unsub+engage_digest_email@unsubscribe.facebook.com> 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:unsub+engage_digest_email@unsubscribe.facebook.com> Errors-To: update+pmhd_um@facebookmail.com X-FACEBOOK-PRIORITY: 1
因此,通过我的PHPmailer设置,我添加了addCustomHeader()函数.
$x = new PHPMailer(); $x->From = "support@veepiz.com"; $x->FromName = "Veepiz Support"; $x->AddAddress($o->emailaddress,$o->toname); $x->AddReplyTo("support@veepiz.com","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 = 'support@veepiz.com'; $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",wordwrap($x->AltBody,80)); $x->AddCustomHeader("List-Unsubscribe: <mailto:unsubscribe@veepiz.com?subject=Unsubscribe>,<http://www.veepiz.com/unsubscribe.PHP?unsubscribeid=$ox->id>");
List-Unsubscribe: <mailto:unsubscribe@veepiz.com?subject=Unsubscribe>,<http://www.veepiz.com/unsubscribe.PHP?unsubscribeid=1>
似乎PHPmailer正在添加此标头,它符合rfc http://www.list-unsubscribe.com/
但是在Hotmail中我没有得到组件显示我已经订阅了blah blah邮件列表取消订阅
You’re subscribed to this mailing list. Unsubscribe