I'm using Postfix mail server on a LAMP stack. I use phpmailer to send my mail. I recently noticed that major ISP's have added support for the "List-Unsubscribe" header. according to Hotmail, live automatically adds a
You're subscribed to this mailing list. Unsubscribe
I noticed this when checking my Facebook mail. So when I examined the Facebook headers I noticed this line
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
So with my phpmailer setup I added the addCustomHeader() function.
$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", "\n", wordwrap($x->AltBody,80));
$x->AddCustomHeader("List-Unsubscribe: <mailto:unsubscribe@veepiz.com?subject=Unsubscribe>, <http://www.veepiz.com/unsubscribe.php?unsubscribeid=$ox->id>");
Now when I send my mail I get this in my mail headers...
List-Unsubscribe: <mailto:unsubscribe@veepiz.com?subject=Unsubscribe>,<http://www.veepiz.com/unsubscribe.php?unsubscribeid=1>
It seems phpmailer is adding this header and it conforms to the rfc http://www.list-unsubscribe.com/
But in Hotmail I don't get the component showing that i've subscribed to blah blah mailing list unsubscribe
You're subscribed to this mailing list. Unsubscribe