I am trying to send mail via php script and comparatively new to php. I wrote below code:
<?php
$to = "xyz@somedomain.com";
$subject = "This is subject";
$message = "This is simple text message.";
$header = "From:abc@somedomain.com \r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true )
{
echo "Message sent successfully...";
}
else
{
echo "Message could not be sent...";
}
?>
But I not able to send email and retval is returning false. I am also not able to debug the actual error. Please suggest how can I find the root cause?