Subscribe to
NSLog(); Header Image

Postfix and PHP

I'm attempting to send email via PHP using Mac OS X 10.3's built in mailserver (postfix). I've followed the directions here and received no errors in setting up postfix.

PHP generates no errors in sending the email. However, the email is never received. Does anyone have any ideas what steps I might take next? Most people having trouble sending email from PHP seem to be on Windows (i.e. very little help to me) according to Google's results…

5 Responses to "Postfix and PHP"

  1. Do you have a proper DNS entry & MX record for your host? I find that I can't send or receive email at (using OSX Server's AppleMail rather than postfix) since the reverse DNS doesn't match causing most hosts to reject the connection.

    Check /var/log/mail.log for any error messages.

  2. I did sudo postfix stop and sudo postfix start and got this:

    Mar 17 15:21:40 localhost postfix/postfix-script: stopping the Postfix mail system

    Mar 17 15:21:40 localhost postfix/master[650]: terminating on signal 15

    Mar 17 15:21:44 localhost postfix/postfix-script: starting the Postfix mail system

    Mar 17 15:21:44 localhost postfix/master[811]: daemon started -- version 2.0.10

  3. I also fired up the mail() command in a PHP script after starting the daemon above. No other messages were logged.

  4. I've got it going now. I changed /private/etc/postfix/ with this line:

    myorigin =

    All seems to be well now.

  5. PHP email on Mac OS X

    This might be easy for most folk, but I found it surprisingly difficult to get PHP to send email on my Mac OS X box (running 10.3 - it is a different process for previous versions of OS X). A...