0
我在Windows 7上使用Xampp,我试图使用PHP邮件()函数发送邮件到我的Gmail。该脚本不显示任何错误,邮件()函数实际上返回true使用邮件()函数从本地主机发送邮件
-
水星邮件:(不使用库,例如 Phpmailer)
我已经尝试使用Test Mail Server Tool - 与水银邮件相同的问题
Fake Send mail - 出现“连接超时”错误。
这些都是我的假发送邮件设置:
sendmail.ini
smtp_server=smtp.gmail.com
smtp_port=587 (tried using 465)
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=pass
的php.ini
sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t" has been commented out
这是我的代码:
<?php
$to = '[email protected]';
$subject = 'the the';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
这是的telnet smtp.gmail.com 587的结果是:
220 mx.google.com ESMTP sb3sm19649093pac.14 - gsmtp
451 4.4.2 Timeout - closing connection. sb3sm19649093pac.14 - gsmtp
Connection to host lost.
我已经通过这个论坛类似的问题了,但它仍然不是为我工作。
这是什么,我在这里失踪,你可以提供我的任何其他工具,我应该尝试的链接?谢谢..
phpmailer正在为我工作...我想知道为什么mail()函数不起作用 – depz123
可能是因为Windows发送邮件不会在smtp上进行身份验证,并且无法连接到安全的smtp服务器。需要使用哪个Gmail来连接。 –