PHP mail function send mail but did not received in inbox

HI,

PHP mail function send email successfully but I did not recieved in inbox. This file is on server

this is my code

$to = ‘asadkhan2us@yahoo.com’;
$subject = ‘Testing’;
$message = ‘hello’;
$headers = ‘From: info@directrewardsnetwork.com’ . "\r
" .
‘Reply-To: info@directrewardsnetwork.com’ . "\r
" .
‘X-Mailer: PHP/’ . phpversion();

if(mail($to, $subject, $message, $headers))
{
echo “success”;
}
else
{
echo “fail”;
}

gave me message “success”;

“Success” means “I had enough information to send this email to the mail daemon.”. It does not mean the email was actually SENT.

Standard response to this is “Try using
instead of \r
.” (or you could use the PHP_EOL constant)

Hi,
Maybe the problem is with the mail server. The php mail() function just sends data to a mail server that should send the email.
Try $headers with only From:

$headers = 'From: info@directrewardsnetwork.com';

MarPlo I have tried with that too but did not work…