简体   繁体   English

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

[英]SMTP -> ERROR: Failed to connect to server: Connection timed out (110)

I'm getting this errors while trying to send an email via PHPMailer: 尝试通过PHPMailer发送电子邮件时出现此错误:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/u722941258/public_html/old/account/access/mailer/class.phpmailer.php on line 1727 不推荐使用: preg_replace():不推荐使用/ e修饰符,而是在第1727行的/home/u722941258/public_html/old/account/access/mailer/class.phpmailer.php中使用preg_replace_callback代替

SMTP -> ERROR: Failed to connect to server: Connection timed out (110) SMTP->错误:无法连接到服务器:连接超时(110)

SMTP Error: Could not connect to SMTP host. SMTP错误:无法连接到SMTP主机。


The PHP Code: PHP代码:

function send_mail($email,$message,$subject)
    {
        require_once('mailer/class.phpmailer.php');
        $mail = new PHPMailer();
        $mail->SMTPDebug = 3;    
        $mail->isSMTP();                                      
        $mail->Host = 'smtp.sparkpostmail.com';  
        $mail->SMTPAuth = true;                               
        $mail->Username = 'USER';                 
        $mail->Password = 'SECRET';                           
        $mail->SMTPSecure = 'tls';                            
        $mail->Port = 587;                                    
        $mail->AddAddress($email);
        $mail->SetFrom('admin@email.sosgram.ga','Verificación de Cuentas');
        $mail->AddReplyTo("soporte@email.sosgram.ga","Soporte SOSgram");
        $mail->Subject  = $subject;
        $mail->MsgHTML($message);
        $mail->Send();
    }

Any solution? 有什么办法吗?



Hosting: http://hostinger.es 托管: http//hostinger.es

SMTP: http://sparkpost.com SMTP: http//sparkpost.com

Looks like outgoing port is blocked in your server. 看起来您的服务器中的传出端口被阻止。 You can try using port 2525 . 您可以尝试使用端口2525

If that's also blocked, you can either open one of those two or use php client library which uses port 80/443 and it's very unlikely for those ports to be blocked; 如果这也被阻止,则可以打开这两个端口之一,也可以使用php客户端库 (使用端口80/443),这些端口被阻止的可能性很小;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SMTP->错误:无法连接到服务器:连接超时(110)SMTP错误:无法连接到SMTP主机。 - SMTP -> ERROR: Failed to connect to server: Connection timed out (110) SMTP Error: Could not connect to SMTP host. PHPMailer的臭名昭著的SMTP错误:无法连接到服务器:连接超时(110)SMTP connect()失败 - PHPMailer's infamous SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed PHPMailer SMTP无法连接到服务器:连接超时(110)到Gmail - PHPMailer SMTP Failed to connect to server: Connection timed out (110) to Gmail SMTP错误:无法连接到服务器:使用PHPMailer和Outlook SMTP连接超时(110) - SMTP ERROR: Failed to connect to server: Connection timed out (110) with PHPMailer and Outlook SMTP 无法连接到服务器:连接超时(110)SMTP Connect()失败。 邮件未发送。邮件错误:SMTP Connect()失败 - Failed to connect to server: Connection timed out (110)SMTP Connect() failed. Message was not sent.Mailer error: SMTP Connect() failed SMTP 错误:无法连接到服务器:使用 phpmailer 时连接超时(110) - SMTP ERROR: Failed to connect to server: Connection timed out (110) when using phpmailer SMTP->错误:无法连接到服务器:连接超时(110)以下“发件人”地址失败:xxxxx@gmail.com错误 - SMTP -> ERROR: Failed to connect to server: Connection timed out (110) The following From address failed: xxxxx@gmail.com ERROR 如何解决:PHP中无法通过主机smtp.gmail.com建立连接[连接超时#110]错误 - How to resolve: Connection could not be established with host smtp.gmail.com [Connection timed out #110] error in PHP 通过Laravel使用gmail smtp:[连接超时#110] - Using gmail smtp via Laravel: [Connection timed out #110] 无法打开到服务器的套接字连接。 错误 (110):连接超时 - Couldn't open socket connection to server. Error (110): Connection timed out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM