我已经成功地在少数人内部使用的桌面上使用 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();
?>
这曾经是,但现在不是:
<?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();
?>
我从调试中得到的唯一东西是
客户端 -> SMTP:EHLO 桌面主机名
页面上没有显示任何错误,apache 日志中也没有显示任何错误,如果它们没有显示,我通常会在其中得到 PHP 错误。
我可以通过 25 端口从桌面远程登录到主机,甚至可以输入 EHLO 命令并从服务器获得良好的响应。
我不记得以前有过这个问题,尽管我可能已经解决过一次。我在这里或 Google 上找不到任何有用的东西。
请帮忙。谢谢。