简体   繁体   English

无法使用XAMPP SendMail发送邮件

[英]Unable to send mail using XAMPP SendMail

I trying to send a mail using PHP mail function but unable to do and getting below messages in debug file: 我试图使用PHP邮件功能发送邮件,但无法执行并在调试文件中获取以下消息:

--- MESSAGE BEGIN --- 15/09/23 09:13:49 ** To: xyz@gmail.com 15/09/23 09:13:49 ** Subject: the subject 15/09/23 09:13:49 ** 15/09/23 09:13:49 ** 15/09/23 09:13:49 ** the message 15/09/23 09:13:49 ** --- MESSAGE END --- 15/09/23 09:13:49 ** Connecting to smtp.gmail.com:587 15/09/23 09:14:02 ** Disconnected. ---消息开始--- 15/09/23 09:13:49 **致:xyz@gmail.com 15/09/23 09:13:49 **主题:主题15/09/23 09: 13:49 ** 15/09/23 09:13:49 ** 15/09/23 09:13:49 **消息15/09/23 09:13:49 ** ---消息结束- -15/09/23 09:13:49 **正在连接至smtp.gmail.com:587 15/09/23 09:14:02 **已断开连接。 15/09/23 09:14:02 ** Disconnected. 15/09/23 09:14:02 **已断开连接。 15/09/23 09:14:02 ** Disconnected. 15/09/23 09:14:02 **已断开连接。 15/09/23 09:14:02 ** Socket Error # 11001Host not found. 15/09/23 09:14:02 **找不到套接字错误#11001主机。

For this, I have installed ZAMPP v3.2.1 on Windows7. 为此,我在Windows7上安装了ZAMPP v3.2.1。

And made following entries as: 并作如下输入:

php.ini- php.ini-

SMTP= smtp.gmail.com
smtp_port= 587 
sendmail_from = my gmail id 
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

I downloaded a latest sendmail folder and did these settings in that. 我下载了最新的sendmail文件夹,并在其中进行了这些设置。 Also I tried to use 25 port and SMTP as localhost but they also did not worked. 我也尝试使用25端口和SMTP作为localhost,但是它们也没有起作用。

sendmail.ini- sendmail.ini-

smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
error_logfile=error.log
debug_logfile=debug.log
auth_username=mygmailid
auth_password=mygmailpassword

Tried with ssl, auto etc but did not worked. 尝试过ssl,auto等,但没有用。

Also tried by setting compatibility of send Mail executable file with 'Run as admin' but in that case it needs a acceptation prompt on my machine and if I accepts that then it returns some value in my mail function and I got response as 'Mail Sent' but in actual mail also not received. 还尝试通过将send Mail可执行文件的兼容性设置为“以admin身份运行”来尝试,但是在这种情况下,它需要在我的计算机上接受提示,如果我接受该提示,则它将在我的邮件函数中返回一些值,并且得到的响应为“已发送邮件” ”,但实际上也没有收到。

确保以下扩展启用了php_sockets和php_smtp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM