interactive. media. development.

Solved:Enabling sendmail on localhost for MAMP free version

Enabling the sendmail function on localhost to send and receive emails has turned out to be a project so I decided to figure out the solution and share it with everyone else.

In free version MAMP mail function is not enabled by default and you have to enable it yourself. At, first when I tried out MAMP on my localhost I found out about this when one of the application was not sending out the mail. So, I did some research but was not able to find much of anything however after digging and info gathering around the web and forums I finally found the solution.

Note that MAMP forums suggest to enable Postfix but for some odd reason I wasn't able to get Postfix working with my domain's email settings which is on gmail(google apps).


First thing you have to do is locate php.ini which is located below:

cd /Applications/MAMP/conf/php5.3/php.ini

Next, you will need to open up your php.ini file and find "[mail function]" you should do the following:

Existing MAMP default configuration:
I'm not really sure why MAMP's default [mail function] settings have the Win32 options enabled and the unix path not turned on:

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

; For Win32 only.
;sendmail_from =

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

Change it to this: (you can copy and paste the following code)

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

; For Win32 only.
;sendmail_from =

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path =/usr/sbin/sendmail -t -i -f

Make sure you change your email from to your own email.

The "sendmail_path =/usr/sbin/sendmail -t -i -f" I found this in a forum thread, but figured I would put a little bit more detail into what I discovered so that its easy for people to understand. I've done this testing all in my localhost development it has been very helpful e-mailing me when I test out new applications. This worked for but its not guaranteed that it can work for anyone as it depends on your MAMP and OS version, Hope this helps.


Jieying Fu said...

Very useful! Thank you!

Mark Kindred said...

Thanks! This helped me. Now, if I can just remember to do this when I upgrade PHP in MAMP.

Edward Wilson said...

Is there any help for getting sendmail to work?

Sean said...

@Eduard Yes just follow the instructions here on this post. Very simple man.

Unknown said...

this worked like a charm. Thanks!

Anonymous said...

Hey there. Thanks for posting this. It was very helpful. You might want to add something about looking in the mamp configuration php panel to determine the version of php running so that the active php.ini is edited. For example on my version it's php5.6.6

Che Osman said...

how to enable it on xampp on windows

Sean said...

This solutions still works to this day.

Post a Comment

Add your comment:

© Copyright Triple ROI
165 Tremont St Boston, MA 02111 - Suite 3

Terms of Use | Privacy Policy