I have the below code of php mail
<?PHP
error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors',1);
$sender = 'info@mydomain.com';
$recipient = 'abc@gmail.com';
$subject = "php mail test";
$message = "php test message";
$headers = 'From:' . $sender;
$headers = "MIME-Version: 1.0"."\r\n";
if (mail($recipient, $subject, $message, $headers))
{
echo "Message accepted";
}
else
{
echo "Error: Message not accepted";
}
?>
Now if I put $sender = 'abc@gmail.com' and $recipient = 'info@mydomain.com', its worikng. but if I do it as in the code it stops working.