如何在 MAC OS 中为 mail() 配置 php.ini 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8162529/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 04:04:51  来源:igfitidea点击:

How to configure php.ini file for mail() in MAC OS?

sendmailphp

提问by Sudhakar Reddy Medagam

I'm using MAC OS and using mail() to send the student details to my mail.

我正在使用 MAC OS 并使用 mail() 将学生详细信息发送到我的邮件。

It does not shows any errors, but the details are not sent to mail.

它不会显示任何错误,但不会将详细信息发送到邮件。

Is there any setup in php.ini for SMTP settings?

php.ini 中是否有 SMTP 设置的设置?

回答by Moe

For OSX Yosemite, this fixed me right up:

对于 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"

Ensure that you have your postfixconfigured - check out this link to learn more: http://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/

确保您已postfix配置 - 查看此链接以了解更多信息:http: //benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/

回答by cetver

Mac and php's mail - it's simple.
Check this beautiful article:
http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update

Mac 和 php 的邮件 - 很简单。
检查这篇漂亮的文章:http:
//theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update

回答by CommaToast

You can also use the OS X Server app from the App Store. I believe it's free, at least for developers. If you turn on the Mail option, it sets up postfix for you. You'll need a relay or you'll need your computer to have an established domain; sending e-mail is easy, but not having it rejected is hard :D

您还可以使用 App Store 中的 OS X Server 应用程序。我相信它是免费的,至少对开发者来说是这样。如果您打开邮件选项,它会为您设置后缀。你需要一个中继,或者你需要你的计算机有一个已建立的域;发送电子邮件很容易,但不被拒绝很难:D