Sendmail on Mac OS X Yosemite

I am using the XAMPP stack for web development. I followed this tutorial to configure my machine to send mail from the local host. This worked flawlessly under OS X Mavericks, but Yosemite seems to have broken it.

I tried all the troubleshooting methods for linked mail to no avail and created this small PHP file to test them. This prints false to my machine.

 <?php error_reporting(-1); ini_set('display_errors', 'On'); $headers = array("From: from@example.com ", "Reply-To: replyto@example.com ", "X-Mailer: PHP/" . PHP_VERSION ); $headers = implode("\r\n", $headers); $didhappen = mail(' myemail@email.com ', 'test', 'test', $headers); if($didhappen) { echo 'true'; } else { echo 'false'; } ?> 

I can still send mail using the terminal, for example, if I run the mail example@gmail.com command, my computer will send an email from my personal gmail address (the one I configured for localhost) and it will appear in the @gmail example. com Inbox. However, whenever I use the mail function in PHP, letters never arrive and may never be sent.

I think the problem is sendmail, it generated some crash reports like this ...

 10/19/14 6:42:09.407 PM ReportCrash[13377]: Saved crash report for sendmail[13376] version ??? to /Library/Logs/DiagnosticReports/sendmail_2014-10-19-184209_Trevors-MacBook-Pro.crash 

Any ideas on what Yosemite could break? Or did someone else have this problem?

+5
source share
2 answers

After several attempts to reinstall XAMPP, I finally damaged it and went with the native environments that Mac OS X offers. I followed this tutorial and was able to run Apache, PHP, MySql and PHPMyAdmin on my machine without XAMPP.

I am afraid that the days of XAMPP are over for me.

The PHP mail function now works after completing the tutorial, so this should have been a problem with XAMPP all this time.

+6
source

I think in the apachefriends forum there is a solution for XAMPP on Yosemite.

For reference, the directions on this link above are the following for me:

Modify the file /Applications/XAMPP/etc/php.ini

Look for ";sendmail_path"

And write the following:

sendmail_path = "env -i /usr/sbin/sendmail -t -i"

+16
source

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


All Articles