问题
I need your help. I have a php script to send email to people who register. but that script does not work for hotmail. hotmail users do not receive that email at all. not even in the junk folder. it works perfectly ok for yahoo! Mail. what am i doing wrong. here's the basic mail script:
$to = 'info@mydomain.nl, ****@hotmail.com, ***@live.nl';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
Result: only info@mydomain.nl recieved the mail.
How can I fix this?
Btw, my contact script works great with hotmail.
回答1:
It's not a PHP problem. Those bad mail providers make use of non standard aggressive anti spam policies that silently drop incoming emails.
You should call your sysadmin and let him check the MTA on your PHP servers. Usualy it's a better solution to use the MTA relay given by your PHP Internet Service Provider instead of using a standalone MTA like sendmail on your PHP server machine.
HTH.
回答2:
Hotmail email deliverability is a tricky issue.
Their servers could be rejecting the emails based on the header information in the email, or maybe its rejecting it due to a failure to authenticate the sender domain against the IP address of the web server its being sent from.
If you haven't already, you could try and improve on email deliverability by posting up a SPF record against the domain you're sending from, and see if that helps. MS have information on Sender ID authentication and how to implement it if that is the issue. http://www.microsoft.com/mscorp/safety/technologies/senderid/overview.mspx
If that's not it maybe its the information contained in the email message header that is causing the problem, can you post an example?
来源:https://stackoverflow.com/questions/9979186/cant-send-mails-to-only-hotmail-gmail-etc-works-perfectly