View Full Version : HELP: mail() not working!
tapsemi
4th April 2008, 07:56
My PHP mail() function is now working!
System Info: Running PHP on webserver running Apache, Postfix(for SMTP) and running on CentOS linux. SMTP is working because I can do telnet localhost 25.
My phpinfo() webpage gives the following information:
-----------------
.
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
.
-----------------------
What do you think is the problem or how can I fix it? Any clues/links is highly appreciated. I am totally frustrated now.
so if mail() is not working, the return value of mail() should be false.
To check why mails are not leaving your server, please check the mail logs in /var/log to see what happens while you try to send an email via mail().
tapsemi
4th April 2008, 10:06
I did a tail of the /var/log/maillog. Here are the lines that were generated after I tried to execute the mail script:
(I replaced my real domain name with mydomain.com here)
--------------------------------------
Apr 4 07:04:08 75-126-255-51 postfix/pickup[9377]: CC931CF006B: uid=48 from=<apache>
Apr 4 07:04:08 75-126-255-51 postfix/cleanup[19815]: CC931CF006B: message-id=<20080404070408.CC931CF006B@mydomain.com>
Apr 4 07:04:08 75-126-255-51 postfix/qmgr[13998]: CC931CF006B: from=<apache@mydomain.com>, size=641, nrcpt=1 (queue active)
Apr 4 07:04:08 75-126-255-51 postfix/local[19817]: CC931CF006B: to=<services@mydomain.com>, relay=local, delay=0.04, delays=0.03/0/0/0.01, dsn=5.1.1, status=bounced (unknown user: "services")
Apr 4 07:04:08 75-126-255-51 postfix/cleanup[19815]: D2BC9CF006C: message-id=<20080404070408.D2BC9CF006C@mydomain.com>
Apr 4 07:04:08 75-126-255-51 postfix/qmgr[13998]: D2BC9CF006C: from=<>, size=2306, nrcpt=1 (queue active)
Apr 4 07:04:08 75-126-255-51 postfix/bounce[19818]: CC931CF006B: sender non-delivery notification: D2BC9CF006C
Apr 4 07:04:08 75-126-255-51 postfix/qmgr[13998]: CC931CF006B: removed
Apr 4 07:04:08 75-126-255-51 postfix/local[19817]: D2BC9CF006C: to=<root@mydomain.com>, orig_to=<apache@mydomain.com>, relay=local, delay=0.01, delays=0/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Apr 4 07:04:08 75-126-255-51 postfix/qmgr[13998]: D2BC9CF006C: removed
----------------------------------------
What can we infer from this log file? One more thing, the mail() script is trying to send an email to services@mydomain.com address. It seems to me from this log that the email id services@mydomain.com doesn't exist, however it is not true. I can send email to this address from any normal mail service.
falko
5th April 2008, 21:46
Does the services@mydomain.com account exist on that server?
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.