Send emails from XAMPP to Gmail

Send emails from XAMPP to Gmail

A guide to sending emails to your Gmail account for local development using XAMPP. Download Send Mail ZIP Go to xampp/sendmail and delete everything in there, copy the contents of the ZIP into there. Open sendmail.ini and edit the appropriate lines to this.
smtp_server=smtp.gmail.com
smtp_port=587
auth_username=testaccount@gmail.com
auth_password=password
force_recipient=testaccount@gmail.com
Open php.ini and edit the appropriate fields to this.
[mail function]
SMTP = smtp.gmail.com
smtp_port = 587
sendmail_from = testaccount@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
Check in the folder xampp/php/ext you have the file php_openssl.dll else download it from here. Now back to your php.ini file under the section Windows Extensions, ensure these lines are not commented out or add them.
extension=php_openssl.dll
extension=php_curl.dll
In your new Gmail Account go to My Account and Turn On 'Allow less secure Apps' Restart Apache and you should be ready to go.

Categories: Posts