Send mail from localhost with PHP with MAMP
Solution 1
MAMP PRO already has this, and has a simple interface to do this, I got it and I have it working perfectly. http://www.mamp.info/en/mamp-pro/
Solution 2
The solution on this post finally worked for me. https://tripleroi.com/solvedenabling-sendmail-on-localhost-for-mamp-free-version/
Correct setting in php.ini:
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path =/usr/sbin/sendmail -t -i -f [email protected]
You have to make sure to comment out the Win32 settings. After doing that, my MAMP server on my Mac finally got a mail through.
Solution 3
I used to have an array of problems like this including the email one when I was still using MAMP.
MAMP Pro should fix it all, but I recommend just doing an install of apache/php/mysql yourself. You'll have no more problems with basic stuff like this and it's a free solution.
If you're on OSX apache is already there, php can be installed via homebrew. Mysql can just be downloaded from the official site as an installer.
![Dylan Cross](https://i.stack.imgur.com/hZ6go.png?s=256&g=1)
Dylan Cross
Updated on July 09, 2022Comments
-
Dylan Cross almost 2 years
I've been trying everything I can find on the internet for this, and none of them seem to be working, so I'm doing something wrong and I need some help figuring out what.
[mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = [email protected] ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]
The above code is what I have changed everything to, (except for the email is my actual email (also I'm not sure if yahoo email will work with this or not, so maybe that's the problem?)) I am not sure where the sendmail_path goes to, I cannot find that path anywhere (am I suppose to download some file/program called sendmail?)
also, my APACHE port I have changed to 80, and my MySQL port is 3306, (I don't know if those ports have anything to do with the smpt_port or not)
Any help would be greatly appreciated, thanks!
(if there are any other ways, (easier ways) of doing this, please also let me know).