I have an email form that isn't working. I even copied and pasted exact syntax and inserted my email address. My error handling says its working but I am not receiving the email. and yes I have checked my spam. Here is my code:
$to = 'krummens@krummens.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: krummens@yahoo.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$mailResult = mail($to, $subject, $message, $headers);
if($mailResult) {
echo "Email sent to " . $to;
}
else {
echo "Error sending email";
}
and the result on the page is:
Email sent to krummens@yahoo.com
Any help?