我通过ajax调用将内容从html发布到php。我想发送一封包含该发布内容的HTML电子邮件。我回应了所有内联CSS的发布数据。但在邮件中,我只能看到没有CSS效果的html内容。
我的html代码将有一些静态内容与内容可编辑功能。
.....
$.ajax({
type : 'POST',
url : $("#form").attr('action'),
data : fields,
dataType : 'json',
success: function() {......}....});我的PHP代码发送没有CSS效果的邮件。
$email_body = $_POST[divcontent];
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//create email headers
$headers .= 'From: '.$email_from."\r\n".
'Reply-To: '.$emailid_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_body, $headers);
$array = array('error' => false, 'message' => $message);
echo json_encode($array);
echo json_encode($array);
?>
any suggestions?