不支持PHPMailer EHLO的SMTP错误 [英] SMTP error with PHPMailer EHLO not supported
本文介绍了不支持PHPMailer EHLO的SMTP错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此代码,我想用它向我的客户发送邮件,即参数已检查的参数(***
):
I have this code, which I want to use to send mails to my customers, 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.
推荐答案
将端口更改为587
应该可以:
Changing your port to 587
should work:
$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
这篇关于不支持PHPMailer EHLO的SMTP错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文