lime
lime

Reputation: 35

Getting MAMP to send mail with postfix

I've spent about two hours researching the forums to figure this out, and I know that there are lots of posts about it already, but I am looking for a more general answer.

I want to be able to send email through contact forms in a local enviroment using MAMP. MAMP has a setting for this in their app, but I can not get it to work.

Do I have to enable postfix on my Mac for this to work?

I've also read that not all email providers work with this. Does Apple mail?

Upvotes: 2

Views: 2677

Answers (1)

Eldy
Eldy

Reputation: 508

When you use the PHP instruction "mail()" to send an email, PHP use the command line tool "sendmail" to send your mail.

So you must first be able to send email using "sendmail" from command line before making it work with PHP. Installing postfix may be a solution to have a smtp agent able to send email (it provides a sendmail compatible tool). But having sendmail command should be enough.

Once sendmail is ok, check into your php.ini of MAMP that path to the sendmail command is correctly set.

Once done and MAMP restarted, do a test. If mail is not received, just go into log files of sendmail (called "/var/log/mail.log" on linux, should be something similar on mac) to get more information.

Upvotes: 1

Related Questions