djs1 Posted May 20, 2010 Share Posted May 20, 2010 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 "; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.