Can't send mail from localhost/xampp

随声附和 提交于 2019-12-05 20:16:50

You are using wrong SMTP settings for gmail. The correct ones are:

In php.ini

[mail function]
;SMTP = localhost
;sendmail_from = me@example.com
sendmail_path = "c:\sendmail\sendmail.exe -t -i"

In sendmail.ini

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
auth_username=me@example.com
auth_password=**********

Remeber: If you have enabled 2 step authentication, you have to create an application specific password.

set the smtp_ssl=auto as smtp_ssl=true

because google's smtp server needs ssl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!