【问题标题】:SMTP error with PHPMailer EHLO not supported不支持 PHPMailer EHLO 的 SMTP 错误
【发布时间】:2013-10-13 09:25:40
【问题描述】:

我有这个代码,我想用它来向我的客户发送邮件,PARAMETERS CENSORED (***):

include 'phpmailer/class.phpmailer.php';
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->Host = "smtp.email.it";
$mail->Port = 25; // or 587 465
$mail->IsHTML(true);
$mail->SMTPSecure = 'tls';
$mail->Username = "***";
$mail->Password = "***";
$mail->SetFrom('***');
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress('***');
 if(!$mail->Send())
    {
    echo "Mailer Error: " . $mail->ErrorInfo;
    }
    else
    {
    echo "Message has been sent";
    }

它连接但给出错误:

2013-10-13 09:13:25 CLIENT -> SERVER: EHLO *SITE_CENSORED*
2013-10-13 09:13:25 SMTP ERROR: EHLO command failed: Method EHLO is not supported.
2013-10-13 09:13:25 SMTP NOTICE: EOF caught while checking if connected
SMTP connect() failed.
Mailer Error: SMTP connect() failed.

【问题讨论】:

标签: php smtp phpmailer


【解决方案1】:

将您的端口更改为587 应该可以:

$mail->Port = 587; // or 587 465

我尝试远程登录:

telnet smtp.email.it 25 //not working

telnet smtp.email.it 465 //not working

telnet smtp.email.it 587 //works

【讨论】:

  • 奇怪,当我通过 telnet 输入命令时,HELO 和 EHLO 都有效。你用的是最新版的PHPMailer吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-31
  • 2017-10-15
  • 1970-01-01
相关资源
最近更新 更多