Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   php sendmail problem (http://www.go4expert.com/forums/php-sendmail-problem-t7430/)

google 21Nov2007 12:20

php sendmail problem

I have seen your postings on PHP on this forum so I am writing to you.

I am facing some problems with sendmail function in PHP, below is the code I am using.

$fd = popen("/usr/sbin/sendmail -t","w") or die("Couldn't Open Sendmail");
fputs($fd, "To:".$tomail." \n");
fputs($fd, "From: \"ezfmx\" <support@mclab.kr> \n");
fputs($fd, "Reply-To: \"ezfmx\" <support@mclab.kr> \n");
fputs($fd, "Subject: Test message from my web site \n");
fputs($fd, "X-Mailer: PHP5 \n\n");
fputs($fd, "{$contents} \n");

I have tried changing the headers and used mail() function as well. and the problem is this code only sends email to GMAIL and only my office mail ID. except that no other mail id seems to work. Hotmail, yahoo, Naver.com and other domains seems not working at all.

I feel its not something to do with code. So, I doubt whether we need to register our mail server some where to tell that it is not spammer.

I am not able to find proper info on this since last two days.

can you please let me know what the problem is or if there is nayhting to do about it?

Thanks in advance for your time and help.

pradeep 21Nov2007 13:11

Re: php sendmail problem
The problem with many Mail service providers is that they don't accept from all IP addresses, they only accept from known servers. May be the IP you are sending from an IP that is blacklisted. Also, check the spam folder if the mails you are sending have been marked as spam.

All times are GMT +5.5. The time now is 14:14.