2014-03-12 45 views
1

山魈SMTP - API 110:連接超時ERROR與PHPMailer的山魈SMTP - API 110:連接超時ERROR與PHPMailer的

ERROR

SMTP - >錯誤:無法連接到服務器:連接超時(110) SMTP錯誤:無法連接到SMTP主機。 SMTP - >錯誤:無法連接到服務器:連接超時(110) SMTP錯誤:無法連接到SMTP主機。

示例代碼

<?php 
$mail = new PHPMailer(); 
$mail->IsSMTP(); // telling the class to use SMTP 
$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.mandrillapp.com";  // sets GMAIL as the SMTP server 
$mail->Port = 465;     // set the SMTP port for the GMAIL server 
$mail->Username = 「yourusername」; // GMAIL username 
$mail->Password = 「passowrd」;   // GMAIL password 
?> 

回答

0

我們都在同地面。因此,首先要檢查您的配置:

  1. $ mail-> SMTPSecure =「ssl」; //將前綴設置爲服務器

您是否在使用任何安全線路?如果沒有,你可以刪除這個。

  1. $ mail-> Port = 465; //設置GMAIL服務器的SMTP端口

您應該檢查您使用的端口是否真的是打算使用的端口。 More information about Mandrill ports here

如果以上仍然不能解決問題,然後檢查,並聯系您的網站託管服務提供商,如果他們允許尤其是山魈出站SMTP連接,因爲有些供應商僅在專用服務器上這樣做。點擊此處瞭解詳情:http://help.mandrill.com/entries/24633717-Why-am-I-getting-a-Relay-Access-Denied-error-trying-to-send-through-SMTP-

相關問題