Error sending email using PHP mail() on Mac OS X [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this questionI used to be able to send email using the simple mail() in PHP although since I have upgraded to the latest PHP I am unable to send emails.
When I look at the email log I get the following:
Jun 29 21:14:49 Johns-MacBook postfix/pickup[26503]: 384B6246803: uid=70 from=<_www>
Jun 29 21:14:49 Johns-MacBook postfix/master[26709]: fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
Jun 29 21:14:49 Johns-MacBook postfix/cleanup[26680]: 384B6246803: message-id=<20110629201449.384B6246803@example.com>
Jun 29 21:14:49 Johns-MacBook postfix/qmgr[26504]: 384B6246803: from=<_www@example.com>, size=351, nrcpt=1 (queue active)
Jun 29 21:14:49 Johns-MacBook postfix/local[26683]: 384B6246803: to=<ben@example.com>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "ben")
Jun 29 21:14:49 Johns-MacBook postfix/cleanup[26680]: 3C318246805: message-id=<20110629201449.3C318246805@example.com>
Jun 29 21:14:49 Johns-MacBook postfix/qmgr[26504]: 3C318246805: from=<>, size=2033, nrcpt=1 (queue active)
Jun 29 21:14:49 Johns-MacBook postfix/bounce[26684]: 384B6246803开发者_如何学C: sender non-delivery notification: 3C318246805
Jun 29 21:14:49 Johns-MacBook postfix/qmgr[26504]: 384B6246803: removed
Jun 29 21:14:49 Johns-MacBook postfix/local[26683]: 3C318246805: to=<_www@example.com>, relay=local, delay=0, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jun 29 21:14:49 Johns-MacBook postfix/qmgr[26504]: 3C318246805: removed
To fix the fatal: open lock file pid/master.pid: unable to set exclusive lock: Resource temporarily unavailable
problem:
Have a look at your php.ini
file and make sure that you can see this line:
sendmail_path = sendmail -t -i
or
sendmail_path = /usr/sbin/sendmail -t -i
It shouldn't have any quotes around it and that there is not semi-colon (;) before it. If it's not there or different, change it to match one of the line above.
If that doesn't help, have a look at http://switch.richard5.net/2006/08/19/fatal-open-lock-file-pidmasterpid/ and see if that helps. Since you've updated PHP, I doubt that postfix is the problem but you never know.
Also:
You may have postfix configuration issues. It's trying to deliver using the local
relay. If the e-mail your trying to send to isn't one on the local server, you might want to check your /etc/mailnames
and in /etc/postfix/main.cf
check myhostname
, mydomain
and myorigin
.
Set your relayhost
sudo postconf -e relayhost=<your-isp’s-smtp-server>
精彩评论