Attached is a screenshot of an email that's generated from the following code:
$the_name=stripslashes($_POST['name']);
$the_comment = stripslashes($_POST['body']);
$the_comment = str_replace("<P>", "\r\n", "$the_comment");
$the_comment = str_replace("</P>", "", "$the_comment");
$to = "prayer@trinityspringhill.org";
$subject = "prayer request";
$message = "$the_name emailed you with the following prayer request:\n\n$the_comment";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = "From: prayer@trinityspringhill.org\r\n" ."X-Mailer: php";
if (!mail($to, $subject, $message, $headers)) {
echo("<p>Message delivery failed...</p>");
}
I'm having a hard time eliminating the <P> garbage. I've tried html_entity_decode and anything else I can think of to no avail.
The tinymce dynamic has been a blessing and a problem in the way it insert line breaks, but surely there's a way to prevent these characters from showing up on the email.
What am I missing?