Php mail script does not work for hotmail accounts

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:

<?php $to="name \r\n"; $subject = "Test Mail"; $message = "Hello someone."; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Me \r\n"; mail ($to, $subject, $message, $headers); ?>

i tried the following,

  1. changing ‘\n’ instead of ‘\r\n’
  2. adding the fifth parameter to mail ""
    but no luck!!!

Better to post a sample of the message that gets sent, I suggest. Then we can perhaps see and non-compliance.

That means it’s a problem with Hotmail not you.
Most email providers move email from PHP scripts to the junk folder since it can be easily abused by spammers. You should make sure that the people trying to get email don’t have the “Delete Junk automatically”, or “Only accept people from my list” options selected. I had this problem once.

[quote]Most email providers move email from PHP scripts to the junk folder


In my experience email providers cannot in general identify an email as from a PHP script. The OPs problem should be solvable by adjusting the script.

somewhere i read that adding “Return-Path:”; in the header will work. but for me, still it doesn’t. change ‘myname’ to something real and try if anyone wants to…

<?php $to="myname\n"; $subject = "Best Way Found"; $message = "Hello someone."; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: myname\r\n"; $headers .= "Return-Path: "; mail ($to, $subject, $message, $headers); ?>