I've a fairly straight-forward input where users can enter data in html (bolding, font-size, inserting links, etc...).
After entering data, the user submits to save the data and send the contents to coworkers in the form of email. The email portion is working fine, except for the content. The content is not being passed as html. Following is my current attempt at getting php to pass the $body variable as html:
Code: Select all
//Send Confirmation email. Following are the variables for the email
$sendto = $email; // this is the email address collected from the foreach routine.
$e_subject = $subject; // Subject
$message = "<html>'" . $body . "'</html>"; //There are single quotes within the double-quotes, but variable is still not passing as html.
// the following block is commented out. I left it in so you can see another approach I've taken to treat $body as html.
/*$message = "
<html>
<body>
<p>Hello " . $participant . ":</p>
<div>" . $body . "</div>
</body>
</html>
"; */
// Always set content-type when sending HTML email
$header = "MIME-Version: 1.0" . "\r\n";
$header .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$header .= "From: " . $user_email . "\r\n";
// Collect variables from above and insert into the mail() function.
mail($sendto, $e_subject, $message, $header);What syntax do I have to use to force php to pass variable content as html?
Thanks Much - Pavilion