Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using mail() function to send to Hotmail?

Status
Not open for further replies.

paulbradley

Programmer
Oct 9, 2002
158
GB
When I use the mail() function to send emails it works fine to most accounts but they never get through to hotmail - is there a solution to this?

Thanks in advance
 
When you send an email to other addresses, are all the headers correct? Particularly the "From" and "Reply-to" headers?

If you send an email to a Hotmail account through the mail server PHP is using, but using another mail client, does the mail go through?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
i had a similar problem. it turned out to be that hotmail was treating my mail as spam as the assigned address was in a dial-up pool.
 
I use the following code:

$to = "me@nospam.hotmail.com";
$subject = "test";
$message = "will i get through?";
$headers = "From: me@nospam.cs.cf.ac.uk\n";
$headers .= "Reply-To: AuctionWorld <me@nospam.cs.cf.ac.uk.com>\n";

mail ($to, $subject, $message, $headers);

Any ideas? Emails do get through to other web accounts. Thanks.
 
Changed code to:

$to = "nospam@hotmail.com";
$subject = "test";
$message = "will i get through";
$headers = "From: nospam@cs.cf.ac.uk\n";
$headers .= "Reply-To: nospam@cs.cf.ac.uk\n";

mail ($to, $subject, $message, $headers);

And still no luck, any other ideas? Thanks.
 
You might want to try using the 5th parameter to the mail() function, which "really" sets the from address.
Code:
mail ($to, $subject, $message, $headers,'-f nospam@cs.cf.ac.uk');
This works well with sendmail and exim.

I think Hotmail may also be checking spf1 records in the DNS setup for your domain. Google for "spf1 hotmail" and you'll find many postings.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top