I am trying to get this simple php mail script to send mail to my email addres ([email protected]) and I cannot get it to work. I set my sendmail_path in php.ini to the right folder (/etc/sbin/sendmail) but that did not seem to help. What else could I be missing? The script always returns failure.
<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
if(mail($to,$subject,$message,$headers))
echo "Mail Sent.";
else
echo "failure";
?>