Author Topic: SMTP ERROR: Failed to connect to server: Connection refused (111)  (Read 2712 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
I have 2 cwp servers.

I have email created in 1 server.

phpmailer code works fine

When I use the same code in my second server and try to connect to smtp of 1st server, I get

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

I have tried ssl with 465 and tls with 465

I have tried my hostname as well as domain name as server address

I have opened both 465 and 587 in incoming as well as outgoing TCP ports

What am I missing?

Offline
*
Re: SMTP ERROR: Failed to connect to server: Connection refused (111)
« Reply #1 on: June 01, 2023, 07:56:13 PM »
I think your firewall is refusing the conn...
Try disable firewall and check again

Offline
****
Re: SMTP ERROR: Failed to connect to server: Connection refused (111)
« Reply #2 on: June 02, 2023, 02:11:33 AM »
465 is SSL/TLS. You can use STARTTLS with port 25 SMTP or 587 submission if you want to negotiate a secure channel on those ports.

Are you allowing outgoing mail ports in your firewall config file -- /etc/csf/csf.conf?
TCP_IN = "21,22,25,53,80,110,143,443,465,587,993,995,2083,2096,2304"
TCP_OUT = "20,21,22,25,22,53,80,110,113,443,2083,2096,587,993,995,2080,2443"
Code: [Select]
SMTP_PORTS = "25,465,587"
PORTS_imapd = "143,993"
PORTS_pop3d = "110,995"