【发布时间】:2017-05-26 00:46:32
【问题描述】:
我正在使用 Phpmailer 发送电子邮件。最初,当我通过用户名和密码使用 SMTP 时,它工作正常。如果我尝试不使用 SMTP 身份验证,那么它会返回连接超时错误。这是我的代码
<?php
require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = "relay-hosting.secureserver.net";
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->SMTPSecure = false;
$mail->setFrom('xxxx@domainname.com', 'First Last');
$mail->addAddress("xxxx@domainname.com", "Recepient Name");
$mail->addReplyTo("xxxx@domainname.com", "Reply");
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "<i>Mail body in HTML</i>";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
?>
返回的错误是
SMTP 错误:连接服务器失败:连接超时 (110)
mail.log 文件包含
host smtp.secureserver.net[68.178.213.203] refused to talk to
me: 554 p3plibsmtp03-06.prod.phx3.secureserver.net bizsmtp
IB105. Connection refused. <ip address> is listed on the
Exploits Block List (XBL)<http://www.spamhaus.org/query/ip/ip
address> Please visit http://www.spamhaus.org/xbl/ for
more information.
【问题讨论】:
-
您是否检查了您在 www.spamhaus.org 上的 IP 地址,因为错误消息表明它在阻止列表中。
-
是的,我的 ip 列在 XBL 上。
-
这显然是在 GoDaddy 上,但很奇怪,他们应该使用外部黑名单来阻止自己的内部 IP!我建议向 GoDady 询问这件事,以及查看 spamhaus 上的内容。
-
现在我从 spamhaus 中取消了我的 ip。仍然连接超时错误。但是mail.log文件中没有日志
标签: php email dns smtp phpmailer