2017-01-11 1 views
2

이메일을 보내는 데 Phpmailer를 사용하고 있습니다. 처음에는 SMTP를 사용자 이름과 암호로 사용할 때 제대로 작동했습니다. SMTP 인증없이 시도한 경우 연결 시간 초과 오류가 반환됩니다. 여기 내 코드는Phpmailer가 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('x[email protected]', 'First Last'); 
$mail->addAddress("[email protected]", "Recepient Name"); 
$mail->addReplyTo("[email protected]", "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 ERROR: Failed to connect to server: Connection timed out (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. 
+0

www.spamhaus.org에서 귀하의 IP 주소를 확인 했습니까? 오류 메시지가 차단 목록에 나와있는 것처럼 보입니까? – theduck

+0

예 내 IP가 XBL에 나열됩니다. – balaraman

+0

이것은 분명히 GoDaddy에 있지만 외부 블랙리스트를 사용하여 내부 IP를 차단해야한다는 것은 매우 이상합니다! 나는 GoDady에게 이것에 대해 묻는 것은 물론 스팸 하우스에있는 것을 보는 것이 좋습니다. – Synchro

답변

1

당신의 IP가 spamhaus 차단 목록 제거 센터에 등록되어 있는지 확인이 포함되어 있습니다. 그것은 자신의 절차에 따라 그 목록에서 제외 다음 목록에있는 경우

https://www.spamhaus.org/query/ip/your-ip-address

. 그것은 약간의 시간이 걸립니다. 코드에서 SMTP 구성을 제거하십시오.

<?php 
require 'PHPMailerAutoload.php'; 

$mail = new PHPMailer; 
$mail->setFrom('[email protected]', 'First Last'); 
$mail->addAddress("[email protected]", "Recepient Name"); 
$mail->addReplyTo("[email protected]", "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"; 
} 

?> 

저에게 적합합니다.

관련 문제