Jump to content

HTML Formatted Email Problems in MS Outlook Only


djs1

Recommended Posts

Hello,

I'm trying to send an HTML formatted email when a user submits a form on my website.  I've tested the email with several webmail applications and also with Apple's Mail.app and it works perfectly.  The only place I'm having trouble is with MS Outlook (both 2003 and 2007).

 

When the email is viewed in Outlook, I see the raw HTML code preceded with the following header info - "Content-type:text/html;charset=iso-8859-1".

 

I've searched online and on this board for solutions and have tried them all, but I'm still having no luck.  I've even directly copied and pasted other people's code, that they claim is working for them, and I still have no luck in Outlook, so there must be something I'm missing here.

 

Can anyone shed some light on this for me or find a problem in my code below? 

Thanks!

Dave 

 

 

<?php

  // ASSEMBLE HEADERS
  $to = "info@mydomain.com";
  $subject = "Subject";
  $headers = "From: $email\r\n";
  $headers .= "Reply-To: $email\r\n";
  $headers .= "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

  // E-MAIL BODY
  $message = "
  <html>
  <body>
  <p> test </p>
  </body>
  </html>
    ";

  // CONFIRMATION MESSAGE
if ( mail($to,$subject,$message,$headers) ) {
   echo "Thank you, your information has been submitted.  You will be contacted shortly.";
   } else {
   echo "The email has failed! Please Resubmit your information. If this problem persists, please contact us at info@mydomain.com ";
   }

?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.