Html – Outlook Express is not recognizing *some* HTML emails


I'm using HTML emails for a client's newsletter. Not using HTML mails is not an option. I've used PHPMailer for mailing, but I've also tried using PHP's mail() function directly. In both instances, I get the same problem described below. I've tried sending as multipart as well as sending just the HTML version.

In every email client I tried, the emails arrive just fine. By that I mean the email is recognized as an HTML email and the content is rendered. Except on some accounts on Outlook Express. I've not been able to discern why it works for some people and why it doesn't work for others (all using Outlook Express). I have forwarded HTML emails to this account (from gmail as well as from outlook express) and they show up just fine. So the Outlook Express version is definitely capable of showing HTML emails.

Now, in these failing cases, the Outlook Express ignores a significant part of the mail header. I can actually see this: when I view the original source of the email, it shows a part in bold – the header – and a part not in bold – the body.

Below is the email message. I've redacted some "personal" parts.

This part is in bold, recognized by Outlook Express as the header:

DomainKey-Status: no signature
Received: (qmail xxxx invoked by uid xxx); 22 Dec 2008 21:04:33 +0100
To: xxxxxxxxxxxxxxxxxx
Subject: Test
Date: Mon, 22 Dec 2008 21:04:33 +0100

And this part is not in bold, and shows up in the mail content panel of Outlook Express.

From: Root User <xxxxxxxxxxxxxxxxxxxxxx>
Message-ID: <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-Priority: 3
X-Mailer: PHPMailer ( [version 2.0.3]
MIME-Version: 1.0
Content-Type: multipart/alternative;

Content-Type: text/plain; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit

Content-Type: text/html; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit


Best Solution

Okay, I think I solved the problem. The various lines in the header were separated by \r\n and apparently Outlook expected them to be separated by \n only. Even PHPMailer seems to do this, so I'm using PHP's mail() function now.

Related Question