therealwesfoster Posted May 2, 2008 Share Posted May 2, 2008 For some reason, when I send emails from the server along with headers, the headers show up in the email like text... why is that? I've done this many times before.. Here's the code: <?php $confirm_email = "THEIR_EMAIL@gmail.com"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: '.$confirm_email . "\r\n"; $to = "MY_EMAIL@gmail.com"; $message = " <html> <head> <title>Submission</title> </head> <body> Author: ".htmlspecialchars_decode($confirm_author)."<br /> Email: {$confirm_email}<br > </body> </html> "; // Send the confirmation email $mailit = mail($to, "New Article Submission: {$confirm_title}", $message, $headers); ?> It shows up like this (this is all in the body of the email): Content-type: text/html; charset=iso-8859-1 From: THEIR_EMAIL@gmail.com <html> <head> <title>Submission</title> </head> <body> Author: Author<br /> Email: MY_EMAIL@gmail.com<br > </body> </html> (the MY_EMAIL and THEIR_EMAIL is, of course, edit by me and not actually in the code). Please help! Wes Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted May 2, 2008 Author Share Posted May 2, 2008 Well, apparently this line was the problem. $headers = 'MIME-Version: 1.0' . "\r\n"; I wonder why? Wes 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.