Reputation: 1564
I have a form that will dynamically send emailers . This form takes the email id of the recipient ,the subject and the body content.
I am using PHPMailer class to go about this. When it comes to plain text ,the emailers work just fine. But I want to add a functionality where the users can paste html into the body part so that the emailer can parse/read them and send the html'ized version of the emails.
I tried this , but it didn't work as the the entire HTML was mailed as text.
$email_msg = htmlentities($_POST['mail_msg'], ENT_QUOTES, "UTF-8");
Any advice would be helpful .
Thanks in advance.
Upvotes: 2
Views: 76
Reputation: 11943
Modify your mail headers :
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset: utf8\r\n";
Upvotes: 0