PHPMailer挂起发送

use*_*400 6 php apache wamp wampserver phpmailer

我已经在内部少数人使用的桌面上使用WAMPSERVER成功设置了一个Web应用程序,这使用了PHPMailer到内部SMTP服务器而没有加密或身份验证,并且它工作正常.

桌面崩溃,我已迁移到"新"桌面.我有一个SVN设置,所以我甚至使用了大多数相同的文件和配置.可能重要的一个区别是旧桌面是64位而新的是32位.这意味着我正在使用不同版本的WAMPSERVER.

邮件只是挂起.我没有得到PHP错误或PHP超时.我只是永远不会到达我的脚本的末尾.关于这个的疯狂部分是它与身份验证,ssl和gmail一起使用.它只是不适用于我需要的额外简单案例.

这有效:

<?php
require('class.phpmailer.php');
$mail=new PHPMailer();
$mail->ISSMTP();
$mail->Host='smtp.gmail.com';
$mail->Subject='test subj';
$mail->Body='the body email test';
$mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username   = "myemail@gmail.com";  // GMAIL username
$mail->Password   = "mypassword";            // GMAIL password
$mail->AddAddress('toemail@supersecret.com', 'John Doe');
$mail->SetFrom('something@gmail.com', 'First Last');
$mail->Send();
?>
Run Code Online (Sandbox Code Playgroud)

这曾经,但现在不是:

<?php
require('class.phpmailer.php');
$mail=new PHPMailer();
$mail->ISSMTP();
$mail->Host='smtp.internal.com';
$mail->Subject='test subj';
$mail->Body='the body email test';
$mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
$mail->Port       = 25;                   // set the SMTP port for the GMAIL server
$mail->AddAddress('myaddress@somewhere.com', 'John Doe');
$mail->SetFrom('someaddress@mightbereal.com', 'First Last');
$mail->Send();
?>
Run Code Online (Sandbox Code Playgroud)

我从调试中得到的唯一的东西是

客户端 - > SMTP:EHLO thedesktophostname

页面上没有显示错误,并且在apache日志中没有任何内容,如果它们不显示,我通常会收到PHP错误.

我可以通过端口25从桌面远程登录到主机,甚至可以输入EHLO命令并从服务器获得良好的响应.

我以前不记得有这个问题,虽然我可能已经解决了一次.我找不到任何在这里或谷歌上有所帮助的东西.

请帮忙.谢谢.

Lou*_*hon 13

劫持帖子说我有同样的问题,但是在没有将SMTPSecure设置为'ssl'的情况下将端口设置为465,默认情况下设置为TLS


use*_*400 2

遗憾的是,这可能永远不会帮助其他遇到同样问题的人,但我只需将端口更改为 465 就可以让一切正常工作。