HTML email formatting

Go To StackoverFlow.com

0

Possible Duplicate:
mail() header problem for html email

I'm using the following for $headers:

        $headers = "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
        $headers .= "From: " .  $from . "\r\n"; 
        $headers .= "Reply-To: ". $from . "\r\n";
        $headers .= "CC: me@site.com\r\n";

My html looks fine in Gmail, however, it appears as raw html in outlook.

Did I forget something in the header?

2012-04-05 01:02
by Paul Dessert
is your outlook allowed to display html? corporates sometimes disable it and dont notice due to outlooks own rich text formatting being good enoug - Louis 2012-04-05 01:05
You should use a Mail class like SwiftMailer - binarious 2012-04-05 01:06
@Louis - Yes, I can receive HTM - Paul Dessert 2012-04-05 01:06
@binarious - I really don't want to add a class. This is simply a notification email getting sent when a user registers - Paul Dessert 2012-04-05 01:08
What's wrong with one of the many pre-built libraries that does this - Incognito 2012-04-05 01:09
@Paul maybe check this http://stackoverflow.com/questions/2149366/outlook-2007-receives-html-mail-as-source-with-headers-others-muas-work-fine- - binarious 2012-04-05 01:09
@Incognito Nothing wrong - it just seems like overkill for a simple task PHP can handl - Paul Dessert 2012-04-05 01:10
Check out this solution to a similar problem: http://stackoverflow.com/a/2423592/101206 - Shawn H. 2012-04-05 01:10
Mmm... Libraries - Robert Harvey 2012-04-05 01:43
Might want to take a read.... http://www.heavyworks.net/blog/posts/quick-tip-php-mail-header-misuse-vulnerabilit - rlemon 2012-04-05 01:52
@ShawnH. - Thanks Shawn! That solved my problem. If you submit an answer, I'd be happy to accept it - Paul Dessert 2012-04-05 17:27


0

I checked out the question located here https://stackoverflow.com/a/2423592/1012061 as @Shawn H. recommended in the comments above.

One of the answers says this:

"I had a very similar problem, try removing the /r from your returns and use only /n. Outlook andd hotmail have trouble with /r/n."

That worked great!

2012-04-05 17:26
by Paul Dessert


0

In outlook 2007 (at least). It is possible to change the email-format. Have a look at: Tools > Options > E-Mail-Format (tab) > Messageformat (select box) > change to html

Hope that helps.

2012-04-05 01:19
by F. Müller
Ads