Anyone noticed that stupid “email@example.com; on behalf of; firstname.lastname@example.org” bug in subject when you received email with Outlook 2007 and 2010?
Well, the fix is pretty simple. While we were setting the From: <email@example.com> header, now we need to set the Sender header too. So it looks like:
$header=''; $header.="Sender: $from\r\n"; $header.="From: $from\r\n"; $header.="MIME-Version: 1.0\r\n"; $header.="Content-Type: text/html; charset=utf-8\r\n"; $header.="Content-Transfer-Encoding: 8bit\r\n"; mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $text, $header);
And that’s it. It took me a while googling for the issue to find it, but hopefully it saves your day!