简体   繁体   中英

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

I'm using MAC OS and using mail() to send the student details to my 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?

For OSX Yosemite, this fixed me right up:

; 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 postfix configured - check out this link to learn more: http://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/

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

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

Yes, it says

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

but it seems that this is available on MacOS, too. For test mails, you can set this to your mail provider's inbound mailserver. If you want to send real mail from localhost you need a solution that supports SMTP auth, PHPMailer being one of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM