SMTP错误:无法连接到服务器:连接超时(110)与PHPMailer和Outlook SMTP [英] SMTP ERROR: Failed to connect to server: Connection timed out (110) with PHPMailer and Outlook SMTP

查看:4093
本文介绍了SMTP错误:无法连接到服务器:连接超时(110)与PHPMailer和Outlook SMTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP Mailer和Outlook SMTP发送SMTP错误。我在这里感到困惑,因为它在端口号为25的本地主机上工作正常,但是在主机服务器上不工作,我已尝试所有使用SSL& TLS。

I am getting SMTP Error with PHP Mailer and Outlook SMTP. I am confused here because it is working fine on localhost with Port number 25 but It is not working on Hosting Server, I have tried all ports with SSL & TLS.


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

Error : SMTP ERROR: Failed to connect to server: Connection timed out (110)




我的代码:

<?php

include("PHPMailer.php"); 

error_reporting(E_ALL);
ini_set('display_errors', '1');

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.live.com";
$mail->SMTPDebug = 2;
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Username = "info@neelcomputech.com";
$mail->Password = "password";
$mail->Priority    = 1;
$mail->CharSet     = 'UTF-8';
$mail->ContentType = 'text/html; charset=utf-8\r\n';

$mail->From = "info@neelcomputech.com";
$mail->FromName = $name;
$mail->AddAddress("info@neelcomputech.com");

$mail->IsHTML(true);

$mail->Subject = "You got Message from Website";
$mail->Body = "testing";

if(!$mail->Send())
{
    echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else
{
    echo 'success';
}

?>



请帮我解决这个问题。我有共享Linux托管。


Please help me to solve this issue. I have Shared Linux Hosting.

推荐答案

Mos可能不是您的主机支持的phpmailer。您必须通过创建新文件进行检查,并检查简单的PHP电子邮件功能。大多数情况下,SMTP在您的托管服务提供商处未配置

Mos probably phpmailer not supported by your hosting. You must have to cross check by creating new file and check simple php email function. Most probably SMTP not configure at your hosting provider

<?php
$to = "somebody@example.com";
$subject = "My subject";

$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$headers);
?>

这篇关于SMTP错误:无法连接到服务器:连接超时(110)与PHPMailer和Outlook SMTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆