PHP Mail Issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mabsey
Forum Newbie
Posts: 4
Joined: Wed Jun 27, 2007 8:50 am

PHP Mail Issues

Post by mabsey »

Hi,

I have wrote a small PHP script using the mail( command. Everything is working fine when sending e-mails to hotmail receipients etc, but the minute I try and mail someone with a ISP mail address, they dont receive the e-mail.

I checked my php.ini file and have the following:

sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i

I specified the sendmail_from address in my php file itself, so any ideas what else could be wrong.

I have searched the forum and seen everyone recommended swift mailer, but dont want to go down that route yet.

Thanks

Mabs
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: PHP Mail Issues

Post by volka »

mabsey wrote:I have searched the forum and seen everyone recommended swift mailer, but dont want to go down that route yet.
For a special reason?
Everything is working fine when sending e-mails to hotmail receipients etc, but the minute I try and mail someone with a ISP mail address, they dont receive the e-mail.
What falls in the etc and what in the ISP mail category?
mabsey
Forum Newbie
Posts: 4
Joined: Wed Jun 27, 2007 8:50 am

Post by mabsey »

When I say it fails, I mean they simply dont receive the message. Hotmail recipients get the message the near instant I run the script. As an example If I try and send a mail to:

Anyone@ntlworld.com (uk service Provider)

no one received there e-mail even though the php script says the mail was sent successful if I add that parameter.



Example of the simple script:

Code: Select all

<?php 
ini_set ("sendmail_from","admin@mydomain.be");
mail('anyone@ntlworld.com', Registration Success', 'Well done you registered.', 
    "From: admin@mydomain.be\nX-Mailer: PHP 4.x"); 
?>
Change the anyone@ntlworld.com to anyone@hotmail.com and it works everytime.

Mabsey
User avatar
idevlin
Forum Commoner
Posts: 78
Joined: Tue Jun 26, 2007 1:10 pm
Location: Cambridge, UK

Post by idevlin »

Have you tried any other email addresses other than @hotmail.com and @ntlworld.com? Like yahoo, gmail, googlemail, etc? Your domain might be black-listed by NTL for some odd reason. It's worth a try. If it's defnitely only NTL, then you may need to contact them and ask them if they block you, or something.

Just a thought.
Post Reply