The problem is you won't be trusted to deliver mail directly to most mail servers unless you have a static IP. Even then thats no guarantee. What you have to do is relay through your ISP's SMTP server where you're "trusted". You should also be able to setup PHP to use your ISP's SMTP server and never touch the SMTP service on your local machine (if you don't feel like playing with Postfix). On Thu, Oct 22, 2009 at 3:56 PM, James Prentice <prentice.j.a@xxxxxxxxx> wrote: > I'm trying to use the php mail() function to send a mail within a php > script. This is using PHP 5.2.4 and Ubuntu Hardy Heron linux. The > script runs fine and the return value of the mail function is TRUE, > but the mail is never received. I'm trying to send an email to my > gmail account via the local server on my machine, just to test if this > script works. > > I installed postfix because I read in several places that people have > had good luck with that mail program. From what I can tell, postfix is > working. I can do: > > telnet localhost 25 > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > 220 homemade ESMTP Postfix (Ubuntu) > ehlo localhost > 250-homemade > 250-PIPELINING > 250-SIZE 10240000 > 250-VRFY > 250-ETRN > 250-STARTTLS > 250-ENHANCEDSTATUSCODES > 250-8BITMIME > 250 DSN > > After the php script runs, I type 'mailq' and get the result 'mail > queue is empty.' If I check /var/log/mail.log, this is what I see: > > Oct 21 23:54:35 homemade postfix/pickup[5735]: 2A31EA70109: uid=33 > from=<www-data> > Oct 21 23:54:35 homemade postfix/cleanup[7997]: 2A31EA70109: > message-id=<20091022065435.2A31EA70109@homemade> > Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: > from=<www-data@homemade>, size=499, nrcpt=1 (queue active) > Oct 21 23:54:35 homemade postfix/error[7999]: 2A31EA70109: > to=<xxx@xxxxxxxxx>, relay=none, delay=0.04, delays=0.03/0/0/0.01, > dsn=5.0.0, status=bounced (gmail.com) > Oct 21 23:54:35 homemade postfix/cleanup[7997]: 3217DA7010A: > message-id=<20091022065435.3217DA7010A@homemade> > Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: from=<>, > size=2095, nrcpt=1 (queue active) > Oct 21 23:54:35 homemade postfix/bounce[8000]: 2A31EA70109: sender > non-delivery notification: 3217DA7010A > Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: removed > Oct 21 23:54:35 homemade postfix/local[8001]: 3217DA7010A: > to=<www-data@homemade>, relay=local, delay=0.03, delays=0/0.02/0/0.01, > dsn=2.0.0, status=sent (delivered to command: procmail -a > "$EXTENSION") > Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: removed > > Any ideas? I am new both to php and postfix. Thanks for any help. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php