Outlook 2007 receives html mail as source with headers, others MUAs work fine. Why?

Posted by Adriano Varoli Piazza on Stack Overflow See other posts from Stack Overflow or by Adriano Varoli Piazza
Published on 2010-01-27T18:29:30Z Indexed on 2010/03/11 20:49 UTC
Read the original article Hit count: 330

Filed under:
|
|

I have a couple of simple forms that send an html-only email. Most clients (Gmail, Lotus Notes 8, hotmail/live, windows live mail, outlook express) receive the emails just fine, but Outlook 2007 does not.

The code looks like this:

$data="
            <html>
                <body>
                    <strong><u>$sub</u></strong><br><br>
                    <strong>Name:</strong> {$_POST["nombre"]}<br><br>
                    <strong>Phone:</strong>{$_POST["telefono"]}<br><br>
                    <strong>Email:</strong> {$_POST["email"]}<br><br>
            <strong>Subject:</strong> {$_POST["asunto"]}<br><br>
                    <strong>Question:</strong> {$_POST["consulta"]}</strong>
                </body>
            </html>";
            $header = "Reply-To: $from\r\n";
            $header .= "From: \"".$_POST["nombre"]."\" <$from>\r\n";
            $header .= "MIME-Version: 1.0\r\n";
            $header .= "Content-Type: text/html; charset=iso-8859-1\r\n";

            $enviado = mail($destino,$sub,$data,$header);

($from is the only part of the message validated)

The message received by the customer looks like this:

Content-Type: text/html; charset=iso-8859-1
From: Consulta de "Boss" <[email protected]>
Reply-To: [email protected]
X-Mailer: PHP/

<strong><u>Solicitud de envío de recetas -
CLIENT</u></strong><br><br><strong>Nombre y Apellido:</strong>
Boss<br><br><strong>Email:</strong>
[email protected]<br><br><br>

Any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about html-email