How To Send Emails Using Google SMTP Server Using XAMPP?

吃可爱长大的小学妹 提交于 2019-12-20 05:16:07

问题


In php.ini I set:

SMTP = smtp.gmail.com
smtp_port = 465

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = mygmail@gmail.com

In my sendmail.ini:

smtp_server=smtp.gmail.com
smtp_ssl=ssl
auth_username=mygmail@gmail.com
auth_password=mygmail password

In my error log:

13/05/18 23:33:30 : Socket Error # 10060<EOL>Connection timed out.

The email actually sent twice, but 99% of the time, I get the same error as above. I disabled my router's SPI, and my computer's firewall. Any ideas?


回答1:


Most local boxes with Windows don't come with a SMTP server. You could use an external SMTP server and configure it in your php.ini file, but SMTP authentication is not possible.

I recommend you to use PHPMailer, is a simple and flexible PHP Class, that can use a SMTP server with authentication. It is also more secure than using bundled PHP mail() function.

http://phpmailer.worxware.com/



来源:https://stackoverflow.com/questions/16619150/how-to-send-emails-using-google-smtp-server-using-xampp

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