PHP mail() no longer works after update to OSX Mountain Lion

浪尽此生 提交于 2019-12-02 14:18:18
Globalfish

Finally I found the solution. After looking at the error_log (/Applications/XAMPP/xamppfiles/logs/error_log), there is an error: sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory

Do the following at your terminal:

sudo mkdir -p /Library/Server/Mail/Data/spool
sudo /usr/sbin/postfix set-permissions
sudo /usr/sbin/postfix start

Then the php mail() works!

Reference: https://apple.stackexchange.com/questions/54051/sendmail-error-on-os-x-mountain-lion

After creating the spool folder as described above, I configured postfix following the directions on this article OS X Hints

I also had to edit my php.ini sendmail path to have some extra switches, specifically

sendmail_path=/usr/sbin/sendmail -t -i
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!