我正在尝试使用php发送电子邮件,其中电子邮件正文由html表的内容填充。我在控制台上没有错误,但数据没有导入。关于我缺少的任何想法?
email.php -
$admin = "sender@email.com";
$email = "recipient@email.com";
$subject = "Alert Activated";
$body = $_POST['content'];
mail($admin, "$subject", $comment, "From:" . $email, $body);
AJAX -
$(document).ready(function(){
$('.export').click(function(){
$.ajax({
type: 'POST',
url: 'email.php',
data: { content: $('#realparts-data').html()}
});
});
});