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 = "[email protected]"; // 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 = "[email protected]"; $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: [email protected] <html> <head> <title>Submission</title> </head> <body> Author: Author<br /> Email: [email protected]<br > </body> </html> (the MY_EMAIL and THEIR_EMAIL is, of course, edit by me and not actually in the code). Please help! Wes Link to comment https://forums.phpfreaks.com/topic/103800-solved-php-mail-help-need-an-experts-eye/ 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 Link to comment https://forums.phpfreaks.com/topic/103800-solved-php-mail-help-need-an-experts-eye/#findComment-531416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.