我正在使用MAC OS,使用mail()将学生的详细信息发送到我的邮箱。
没有显示任何错误,但详细信息没有发送到邮箱。
在php.ini中是否有SMTP设置的设置?
没有显示任何错误,但详细信息没有发送到邮箱。
在php.ini中是否有SMTP设置的设置?
对于OSX Yosemite,这个方法可以解决问题:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
SMTP=localhost
smtp_port=25
sendmail_path = "env -i /usr/sbin/sendmail -t -i"
请确保您已经配置好了postfix
- 点击此链接了解更多信息:http://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/
Mac和php的邮件 - 很简单。
查看这篇精美的文章:
http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update
您也可以从App Store下载OS X Server应用程序。我相信至少对于开发人员来说是免费的。如果您打开邮件选项,它会为您设置postfix。您需要一个中继或者您的计算机需要有一个已建立的域名;发送电子邮件很容易,但不被拒绝却很难:D