php 在 Xampp 中将 Gmail 配置为 SMTP 以发送邮件 -Got Error.Why?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4376701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Configure Gmail as SMTP in Xampp to send mail -Got Error.Why?
提问by svk
I am following thisinstruction and I got the same error like a first user comment.And I dont know how to fix this error.
我正在遵循此说明,但遇到了与第一个用户评论相同的错误。我不知道如何修复此错误。
Short notes what I did.
简短记录我所做的。
1.Change the sendmail.ini and php.ini settings for sending mail
2.Put the dlls on the send mail folder
3.Put my username and password from my gmail account
1.更改发送邮件的sendmail.ini和php.ini设置
2.将dll放在发送邮件文件夹中
3.从我的gmail帐户中输入我的用户名和密码
smtp_server=smtp.gmail.com
smtp_port=465
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
;smtp_ssl=auto
smtp_ssl=tls
default_domain=brettshaffer.com
error_logfile=error.log
Tried both tsl and ssl same error.Error is below.
尝试了 tsl 和 ssl 相同的错误。错误如下。
10/12/07 18:03:36 : Connection Closed Gracefully.
Updated
更新
[email protected]
auth_password=mypassword
I already put there and also I put two ssl dlls for that SSL connection
我已经放在那里了,而且我还为那个 SSL 连接放了两个 ssl dll
libeay32.dll
ssleay32.dll
回答by Wesley
since you are using xampp it would be easier to use phpmailer script:
由于您使用的是 xampp,因此使用 phpmailer 脚本会更容易:
and if you insist on using xampp you should set: smtp_ssl = ssl
如果你坚持使用 xampp 你应该设置:smtp_ssl = ssl
and configure the sendmail.ini so that it connects with your @gmail.com account credentials. or it will not be able to connect.
并配置 sendmail.ini 以便它与您的 @gmail.com 帐户凭据连接。否则将无法连接。