Php SMTP错误:无法连接到服务器:连接超时(110)

Php SMTP错误:无法连接到服务器:连接超时(110),php,email,mandrill,Php,Email,Mandrill,我用曼陀罗发送电子邮件。它在我的本地主机上工作。我可以从本地主机发送邮件。但是当我在测试服务器上使用它时,它并没有连接到mandrill服务器。它显示了上述错误。我检查了端口,它是打开的。我可以从我的服务器使用gmail smtp。它很好用。但我需要用曼陀罗。我还添加了域上的DKIM和SPF记录。但仍然没有连接到smtp.mandrillapi.com 这是我使用的代码 Connection: opening to smtp.mandrillapp.com:587, timeout=300, o

我用曼陀罗发送电子邮件。它在我的本地主机上工作。我可以从本地主机发送邮件。但是当我在测试服务器上使用它时,它并没有连接到mandrill服务器。它显示了上述错误。我检查了端口,它是打开的。我可以从我的服务器使用gmail smtp。它很好用。但我需要用曼陀罗。我还添加了域上的DKIM和SPF记录。但仍然没有连接到smtp.mandrillapi.com 这是我使用的代码

Connection: opening to smtp.mandrillapp.com:587, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed.
Message could not be sent.Mailer Error: SMTP connect() failed.

`

它是否从命令行工作?你能用telnet或别的什么连接那个端口吗?我能连接。这是暂时的,或者您的传出防火墙/代理未通过端口587。在我的本地主机中一切正常。该问题仅在测试服务器上发生。从测试服务器,它未连接到smtp.mandrillapp.com
<?php
require 'PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->IsSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.mandrillapp.com';                 // Specify main and backup server
$mail->Port = 587;        // Set the SMTP port
$mail->SMTPDebug = 4;
$mail->Debugoutput='html';
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'example@gmail.com';                // SMTP username
$mail->Password = 'apikey';                  // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted

$mail->From = 'example@gmail.com';
$mail->FromName = 'example';
$mail->AddAddress('example@gmail.com', 'Nidheesh');  // Add a recipient
         // Name is optional
$mail->addReplyTo('example@gmail.com');

$mail->IsHTML(true);                                  // Set email format to HTML

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <strong>in bold!</strong>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->Send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}

echo 'Message has been sent';
?>