Php mail() function not working - 10.5.5

Keep getting this error message when trying to use mail() function in various PHP scripts.

Could not execute mail delivery program '/usr/sbin/sendmail -t -i

Tried

su _www -c /usr/sbin/sendmail
Which also doesnt work. Seems that _www is unable to execuse sendmail in any way. This used to work just fine, maybe it has something to do with the last security update which also updated apache 2.8 to 2.9.

Has anybody a solution to this problem?

Best regards

Xserve, Mac OS X (10.5.5)

Posted on Nov 10, 2008 5:34 AM

Reply
3 replies

Dec 23, 2008 10:04 AM in response to Nocstah

Look at your /var/log/mail.log using Console.
-
You will probably notice a number of entries which resemble:

status=bounced (host mail3.xxxxxx.com[89.193.17.2] said: 553 sorry, your envelope sender domain must exist (#5.7.1) (in reply to RCPT TO command))

If your mail is being routed out through your ISP (as I assume you're not just sending internal email
over your network), their POP3 will object to the origin of the mail because it comes from your 127.0.0.1 default Apache address, which isn't a domain it knows !

This is why sendmail works fine when wrapped in the Apple Mail app, which confirms the veracity of accounts before it lets you use them (overriding this behaviour), and why your PHP script will always run fine on a (hosting) server which is 'known' to the rest of the planet.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Php mail() function not working - 10.5.5

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.