0

I have the below code of php mail

<?PHP
error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors',1);

$sender = '[email protected]';
$recipient = '[email protected]';

$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 = '[email protected]' and $recipient = '[email protected]', its worikng. but if I do it as in the code it stops working.

saptak das
  • 11
  • 1

0 Answers0