Hi
I am working to send email with the html body. Body html is posted by php variable with ajax. but all html will be ignored.
for example in email.php
HTML element
<textarea id="html" cols="20" name="TextArea1" rows="2">HTML code is here</textarea>
Javascript
var html = $("#html").val();
$.post("function.php", { html: html }, function(data) {
if(data){
//do sth
}
});
and in function php
$body = "";
$body .= $_POST['html'];
//send email
I tried html_entity_decode
but no luck. the email is sent, comes without html elements. how can i do this ?
Thanks
EDIT: I got the problem, in HTML there is ' character and it disrupts the HTML structure.
But how can i avoid this, i still don't know...
EDIT 2 : stripslashes() made it ! Thanks...