For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > June 2007 > mail() Oulook









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author mail() Oulook
misiek

2007-06-04, 6:58 pm

In Outlook does not parse correctly when email is sent as hmtl

I use this code which I fountd on php.net

I just spent a few hours working on getting a simple html formatted
email to work on outlook. This is the end result:

<?php
$body="<em>HTML</em> formatted <strong>Message</strong";

$headers = "From: info@example.com \r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1 ";
$headers .= "MIME-Version: 1.0 ";
/*notice there aren't any \r\n after the second two header additions.
This is what made this version work correctly*/
mail("john@example.com", "An HTML Message", $body, $headers);
?>


the body shows up as a text/plain
C.

2007-06-06, 9:58 pm

On 4 Jun, 19:39, misiek <michal_augustyn...@gazeta.pl> wrote:
> In Outlook does not parse correctly when email is sent as hmtl
>
> I use this code which I fountd on php.net
>
> I just spent a few hours working on getting a simple html formatted
> email to work on outlook. This is the end result:
>
> <?php
> $body="<em>HTML</em> formatted <strong>Message</strong";
>
> $headers = "From: i...@example.com \r\n";
> $headers .= "Content-Type: text/html; charset=ISO-8859-1 ";
> $headers .= "MIME-Version: 1.0 ";
> /*notice there aren't any \r\n after the second two header additions.
> This is what made this version work correctly*/
> mail("j...@example.com", "An HTML Message", $body, $headers);
> ?>
>
> the body shows up as a text/plain



Outlook is broken in many regards, but this is not one of them. Try
viewing the source of an email which seems to behave correctly in
Outlook. You should find that it complies with rfc2183 - i.e. the
content-disposition on the HTML MIME section is inline.

C.

Derdickerterten

2007-06-14, 9:15 am

Nikki Cox and Lindsay Lohan Crazy On High Heels!
http://www.freedutchmovies.com/WatchMovie?vid=1673286
Notorious

2007-06-21, 11:18 am

Laetitia Casta and Hilary Swank , Weird Lesbian Sex Act!
http://www.videomoviesonline.com/Watch?clip=1673286
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com