I'm trying to add some mark-up to an email that's generated by a PHP script, but it doesn't appear to be parsing the tags as they are are visible in the email along with the content. Any help would be really appreciated. Thanks!
Script:
<?php
$name = Trim(stripslashes($_POST['name']));
$email = Trim(stripslashes($_POST['email']));
$message = Trim(stripslashes($_POST['message']));
$emailFrom = $email;
$emailTo = "[email protected]";
$subject = "Subject Line";
// Prepare email body text
$body = "<strong>Name:</strong> $name <br /> Email: $email <br /> Message: $message";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Send email
$success = mail($emailTo, $subject, $body, "From: $name <$emailFrom>");
// Redirect to success or error pages
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>
Output:
<strong>Name:</strong> My Name <br /> Email: [email protected] <br /> Message: TEST