I have form in my site and I tried to send messege to email address. I get values from the form and send to a php file by ajax.Then in sendmail.php file I send email with mail()
function. And mail()
doesn't send to email, and returns something like this :
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; col.........
this is my js code
$.ajax({
url: "sendmail.php",
data: {name:name.val(),email:email.val(),subject:subject.val(),messege:messege.value},
type: "POST",
success:function(data){
console.log(data);
}
})
and this is in sendmail.php file
<?php
$to = "email@mail.com";
$name =$_POST['name'];
$email =$_POST['email'];
$subject =$_POST['subject'];
$messege =$_POST['messege'];
if(mail($to,$subject,$messege)) {
echo 'Email on the way';
}
?>
Who knows why?