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

I use MAC OS and using mail () to send student details to my mail.

It does not show any errors, but the details are not sent by mail.

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

+6
source share
4 answers

For OSX Yosemite, this fixed me directly:

; 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" 

Make sure you have postfix configured - check out this link to find out more: http://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/

+6
source

Mac and php mail is easy.
Check out this beautiful article:
http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update

+3
source

Yes he says

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

but it looks like it's available on macOS too. For test emails, you can install this on your mail server mail provider. If you want to send real mail from localhost, you need a solution that supports SMTP auth, PHPMailer , which is one of them.

0
source

You can also use the OS X Server app from the App Store. I find it free, at least for developers. If you enable the Mail option, it will set a postfix for you. You will need a relay, or you will need your computer to have an established domain; sending email is easy, but not hard to discard: D

0
source

Source: https://habr.com/ru/post/901686/


All Articles