我已经在内部几个人使用的桌面上使用 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 = "[email protected]"; // GMAIL username
$mail->Password = "mypassword"; // GMAIL password
$mail->AddAddress('[email protected]', 'John Doe');
$mail->SetFrom('[email protected]', '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('[email protected]', 'John Doe');
$mail->SetFrom('somea[email protected]', 'First Last');
$mail->Send();
?>
我从调试中得到的唯一结果是
客户端 -> SMTP:EHLO 桌面主机名
页面上没有显示任何错误,apache 日志中也没有任何内容,如果不显示,我通常会在其中收到 PHP 错误。
我可以从桌面上的端口 25 远程登录到主机,甚至可以输入 EHLO 命令并从服务器获得良好的响应。
我不记得以前遇到过这个问题,尽管我可能已经解决过一次了。我在这里或谷歌上找不到任何有帮助的东西。
请帮忙。谢谢。