View Full Version : htmlspecialchars for email content

10-27-2012, 02:04 PM
hi all

I have this below code for <textarea> in which person enters his enquiry

$body="Hi \n<br><br>".htmlspecialchars($name). " had sent you enquiry . ". " \n<br><br>
Person Enquiry = ". htmlspecialchars($enquiry) . " \n<br><br> ";

after person enters enquiry the email is sent with the enquiry entered.

i receive enquiry content as

yo man\r\n\r\ntesting new site\r\n\r\nstay tuned\r\n\r\nvineet

how can i use htmlspecialchars in the way it doesnt echoes \r\n\r\


10-27-2012, 11:18 PM
Well those characters wouldn't be visible in an HTML email and you shouldn't be using htmlspecialchars for a plain text email so presumably the solution is to get rud of the htmlspecialchars call that shouldn't be there so as to allow the plain text to display properly in the email.