I have this simple program, which displays 'Success' in sending mail. But it is not actually received in the inbox or spam. What could be the issue?
mail.php
<?php
$to = "xyz@gmail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: abc@gmail.com";
$result = mail($to,$subject,$txt,$headers);
if(!$result) {
echo "Error";
} else {
echo "Success";
}
?>