Outlook Express does not recognize * some * HTML emails

I use HTML emails to send newsletters to clients. Not using HTML emails is not . I used PHPMailer for mailing, but I also tried using PHP's mail () function directly. In both cases I am having the same problem described below. I've tried posting both multi-page and posting only the HTML version.

In every email client I've tried, emails come in just fine. By this I mean the email is recognized as HTML email and the content is displayed. Except for some accounts in Outlook Express . I haven't been able to figure out why it works for some people and why it doesn't work for others (everyone uses Outlook Express). I have sent HTML emails to this account (from gmail as well as from Outlook Express) and they display just fine. So the Outlook Express version is definitely capable of displaying HTML emails.

Now, in these unfortunate cases, Outlook Express ignores a significant portion of the mail header. I can actually see it: when I look at the original email source , it displays in bold - the heading - and the part not in bold - the body.

Below is the email message. I edited some of the "personal" parts.

This part is in bold and is recognized by Outlook Express as a 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 appears in the content pane of Outlook Express mail.

From: Root User <xxxxxxxxxxxxxxxxxxxxxx>
Message-ID: <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.3]
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_cb79043f473b53e87bfa759755fce3ce"

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

--b1_cb79043f473b53e87bfa759755fce3ce
Content-Type: text/html; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit
<p>Test</p>

--b1_cb79043f473b53e87bfa759755fce3ce--

      

+1


source to share


4 answers


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



+1


source


Adding a new line before the HTML in the second MIME block will fix your problem. You can also set "Content-Disposition: inline" on this block if you like. In my tests, I still had to hit Alt + Shift + H in Outlook Express, as it defaults to plain text for security reasons.

Here is the final working EML:



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
From: Root User <xxxxxxxxxxxxxxxxxxxxxx>
Message-ID: <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.3]
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_cb79043f473b53e87bfa759755fce3ce"

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

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

<p>Test</p>

--b1_cb79043f473b53e87bfa759755fce3ce-- 

      

0


source


Try changing your border creation:

/* Set the boundaries */
$uniq_id = md5(uniqid(time()));

$this->boundary[1] = '------------01' . $uniq_id; // was started by b1_

$this->boundary[2] = '------------02' . $uniq_id; // was started by b2_

Tomor.cz

      

Edit: This is not a solution :: /

But I found that if I use phpmailer via SMTP server it is ok and when I send email via mail () function it is a problem in Outlook then ..

0


source


I found that if this problem occurs when I am using PHPMailer v 2.3. When I upgraded to PHPMailer_v5.0.2, emails are displayed correctly in Outlook.

0


source







All Articles