SMTP -> ERROR: Failed to connect to server: Connection refused (111)

0

Error which I am getting :

SMTP -> ERROR: Failed to connect to server: Connection refused (111)

Below Code which I am using in my own server using PHPMailer ::

$mail->isSMTP(); // Set mailer to use SMTP $mail->SMTPKeepAlive = true; $mail->Host = 'email-smtp.us-east-1.amazonaws.com'; // Specify server+ $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'xxxxxxxxx'; // SMTP username $mail->Password = 'xxxxxxxx'; // SMTP password $mail->Port = 587; // Recommended Port $mail->SMTPSecure = 'tls';
$mail->Priority = "1";

What cld be the reason , It was working fine for last 5/6 years

2回答
1

A connection refused means that when trying to establish a TCP connection to :587 on email-smtp.us-east-1.amazonaws.com the server (or something in between, like a firewall) responded with a reset packet.

My suggestion, first check if you can reach email-smtp.us-east-1.amazonaws.com outside of your PHP program, from the machine that is running PHP, if you are running linux you can do it with NC as follows:

% nc -4 -v email-smtp.us-east-1.amazonaws.com 587 Connection to email-smtp.us-east-1.amazonaws.com port 587 [tcp/submission] succeeded! 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-F1IOSWD55 oz6dMFr1gGLg97gxKjp6

As you can see, from my machine this succeeds.

If you get a connection refused here - then you should start with some network troubleshooting - and see if there is a firewall on your network that is refusing you to connect to port 587 on this host, or the internet in general.

AWS
エキスパート
回答済み 2ヶ月前
profile picture
エキスパート
レビュー済み 2ヶ月前
0

I am on a hosted server and do not have access to the console

回答済み 2ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ