1

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 = xxxxx@gmail.com

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

Any idea to debug this issue?

mamahow
  • 21
  • 2
  • 3

2 Answers2

0

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).

Nebojsa Tomcic
  • 608
  • 5
  • 7
0

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 = yourusername@gmail.com
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
auth_username=yourusername@gmail.com
auth_password=enteryourgmailpasswordhere
force_sender=yourusername@gmail.com
  • Right click on sendmail.exe
  • Properties
  • Compatibility
  • Change settings for all users
  • Compatibility mode: Windows XP (Service Pack 3)
  • Settings: Run this program as an administrator
  • Restart Mamp (or Xampp if you use that, these settings are the same)
  • Success
Flyke
  • 347
  • 3
  • 5