PHPMailer "Connection refused (111)" Error Despite Outbound Ports Being Open

PHPMailer "Connection refused (111)" Error Despite Outbound Ports Being Open

Hello everyone,

I'm trying to send emails via Zoho SMTP using PHPMailer on my shared hosting environment. I've tried both port 465 (ssl) and 587 (tls), and I even added SMTPOptions to bypass SSL verification just in case it was an SSL certificate issue. However, the connection drops instantly. 

Here is my current configuration:

$mail->isSMTP();
$mail->Host       = 'smtppro.zoho.com';
$mail->SMTPAuth   = true; 
$mail->SMTPOptions = array(
    'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);
$mail->Username   = '<myemail>';
$mail->Password   = '<mypassword>'; // application password
$mail->SMTPSecure = 'ssl';
$mail->Port       = 465;
$mail->CharSet    = 'UTF-8'; 

The debug output (SMTPDebug = 2) is very short, meaning it fails at the TCP level before any SMTP negotiation happens:
"SMTP ERROR: Failed to connect to server: Connection refused (111) SMTP Error: Could not connect to SMTP host. Failed to connect to server"

My hosting provider insists that outbound ports 465 and 587 are open. My questions are:
1. Could this be caused by SELinux blocking network connections for the web server (e.g., httpd_can_network_connect = 0)?
2. Is it possible that the server's IPv6 configuration is broken, and PHPMailer is trying to resolve Zoho via IPv6?
3. How can I definitively prove to the hosting provider whether this is an OS/Firewall issue on their end?

Thanks in advance for your insights!

    • Sticky Posts

    • Pocket from Mozilla is closing shop. Don’t lose your favorites . Move them to Zoho Mail Bookmarks now! 📥🔖

      The end of Pocket shouldn't mean the end of your important links and content. Easily import them into Zoho Mail's Bookmarks and continue right where you left off. You can bring over your entire Saves, Collections, and tags just the way they are. Bookmarks
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Workplace - Zoholics Europe Customer Awards

      Dear Zoho Mail Community! 📣 We're excited to announce that at this year's Zoholics events across Europe, we're holding customer awards for the first time ever! Workplace - Zoholics Europe Customer Awards This is your chance to shout about the amazing
    • Important update on Group Management | Zoho Mail

      Dear Zoho Mail Community, This post is to inform you all of the following updates on the Group Management in Zoho Mail. Group Member Addition: If a group member is added to an organization group in a Zoho Application, the member will be automatically
    • Mastering email etiquette and best practices to follow in Zoho Mail

      Hello Zoho Mail Community, We’re thrilled to invite you all to our upcoming webinar: Mastering email etiquette and best practices to follow in Zoho Mail. Join our live webinar for expert etiquette tips to enhance your professionalism and elevate your