Noor's Plugin

WordPress Plugins, Themes, Hosting, Tutorials & more!

  • Home
  • Plugins
  • Themes
  • Contact
    • Privacy Policy
  • About

How to Resolve SMTP Error: Failed to connect to server: Connection refused (111)/Network is unreachable (101)

If you are setting up your WordPress site with a SMTP plugin or using the PHPMailer library for sending email from your web server, you might encounter this SMTP Error: Failed to connect to server: Connection refused (111)/Network is unreachable (101). It’s a common connectivity issue on most shared hosting servers. In this post I will explain the issue in detail and show you how you can resolve it to have a fully functional email/SMTP setup.

SMTP connection requires a port such 25/465/587. Based on the type of connection you may also need to use encryption (e.g. SSL/TLS) or no encryption at all. SSL encryption is mainly used on port 465 where as TLS on port 587. On some shared hosts port 465/587 are blocked by default. This makes it so PHPMailer/SMTP plugin can’t even connect to the remote SMTP server. Sometimes those ports are open but they don’t support encryption. This causes the email to be sent without any encryption which can be a security issue. Your remote SMTP host can also decide which connection to accept. For example: If you try to make a non-encrypted connection to a SMTP host like Gmail (smtp.gmail.com) it will refuse since the connection is not secure. In that case the error may look similar to this,

  • unable to connect to ssl://smtp.gmail.com:465 (connection refused)
  • unable to connect to smtp.gmail.com:587 (connection refused)

Connection refused (111)/Network is unreachable (101) error can also occur if your web host simply doesn’t allow external SMTP connection. This issue is common on a GoDaddy server where they only allow their own SMTP configuration. If you contact them regarding this issue they will assure you that port 465 and 587 are open (when they are not). If you get back to them again they will tell you to use their SMTP server host instead of your own. So if you are on a GoDaddy server and having this issue your SMTP configuration should look like the following:

  • SMTP Host/Server: relay-hosting.secureserver.net
  • Port: 25
  • SMTPAuth: false

This should allow you to send email from your web server without any interruption/error. If you come across a different solution for resolving this type of error feel free to share it in the comments.

Disclosure: This page may contain affiliate links. If you follow one of those affiliate links and purchase something it will provide me with a little bit of a commission. This costs you nothing extra but helps maintain my site, free plugins, and themes. So I thank you for your support.

Related

Written by Noor Alam

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search Noor’s Plugin

Recent Posts

  • How to Check if a Plugin is Safe to Install on Your WordPress Site
  • Does Stripe Accept PayPal?
  • How to Customize the Type of the Stripe Payment Page Button
  • How to Add a Quantity Field to a Stripe Payment Button
  • How to Add a Price Field to a PayPal Button
  • Hide Product Image for WooCommerce Plugin
  • How to Show a Download Button to Logged in Users Only
  • How to Add a Price Field to a Stripe Payment Button
  • How to Disable/Hide Featured Images in WordPress Astra Theme
  • What is the White Screen of Death in WordPress?

Copyright © 2022 · Noor's Plugin

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAcceptRead More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT