Forum Moderators: coopster

Message Too Old, No Replies

PHP mail() function does not send to hotmail or gmail

         

Celadore

5:53 am on Jan 18, 2006 (gmt 0)

10+ Year Member



Hello,

Newbie here. I set up a login verification program. New users get sent an activation code via the mail() function. Problem is that it doesn't send to hotmail or gmail addresses (I assume others like Yahoo won't work either).

I have tried all the other quick fixes revolving around headers, but am still truly lost and have been for a couple of weeks.

Do I need to change anything in the php.ini file or such like? (I don't have root access, so don't know how it is set).

If I can't get it to work... what are my alternatives? (apart from banning Hotmail, gmail and the like from becoming users).

Will I have to use a different language or mail function? If so a link to any resources would be helpful

(Also Horde doesn't send mails to Hotmail or Gmail but can receive them.)

vevs

3:16 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



does it send to email addresses not at Hotmail and Yahoo?

can you paste the code here?

your sever may be blacklisted by Yahoo and Hotmail!

Vevs

Celadore

5:12 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



OK, now it works? I didn't do anything...strange. On my last host it wouldn't go through at all, now on this host it suddenly started going through and is working fine. It has always worked on non Hotmail and Yahoo emails before.

Here's the code, although it is not a problem anymore, it would be good to know why it started working all of a sudden.

$email = "newuser@hotmail.com":
$subject = "welcome";
$message = "welcome message";
$headers = 'From: me@mysite.net' . "\n" .
'Reply-To: me@mysite.net' . "\n" .
'X-Mailer: PHP/' . phpversion();

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

Maybe it had to wait for my DNS to be recognised or something? I don't know.

Robber

5:55 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



It may be that on your old host the reverse DNS wasn't setup correctly, this has caused problems for me in the past with accounts like hotmail, aol etc