Reputation: 21
I use CouchCMS as my content manager for website. I also install MAMP (Windows version) for php/mysql/apache solution. I'm trying to enable phpMail feature to use Gmail's SMTP, but failed.
My php.ini in C:\MAMP\conf\php5.6.3\php.ini
[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 25
auth_username = xxxxxx
auth_password = xxxxxx
; For Win32 only.
sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
Any idea to debug this issue?
Upvotes: 1
Views: 4053
Reputation: 367
I had a lot of trial and error, but finally managed to send mails with Mamp on my Windows 10 machine using these settings:
Edit you php.ini file and change the [mail function] section like this:
[mail function]
SMTP=smtp.gmail.com
smtp_port=465
sendmail_from = [email protected]
sendmail_path = "\"C:\MAMP\bin\sendmail\sendmail.exe\" -t"
mail.log = "C:\MAMP\logs\php_mail.log"
Edit your sendmail.ini file like this:
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=auto
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=enteryourgmailpasswordhere
[email protected]
Upvotes: 0
Reputation: 608
If you use MAMP you need to provide separate SMTP solution. For example, you can install email relay or some other 3rd party software with SMTP server or SMTP relay functionality, configure it and then use it for scripts which are executed in MAMP servers.
SMTP = smtp.gmail.com
smtp_port = 25
smtp.gmail.com can be only accessed over SSL/TLS so you need to use ports like 465 or 587. As php mail send function can only work with no-SSL SMTP servers you can not use it to send email over gmail servers.
So you have to provide your own SMTP solution if using MAMP.
MAMP PRO is already bundled with STMP relay functionality and you can relay your PHP mail messages with it (MAMP PRO uses the default localhost and port 25 so no changes there).
Upvotes: 0