asady
July 18, 2012, 12:20pm
1
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)
MarPlo
July 18, 2012, 12:34pm
3
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';
asady
July 18, 2012, 12:39pm
4
MarPlo I have tried with that too but did not work…