Are you having issues with sending and receiving emails from your website? Do you think a blocked SMTP is the culprit?
In this article, we will address this issue and see how to fix it.
Causes of SMTP blocking
Although email correspondence is an integral part of any website that is worth its salt, there are times when the protocol or port becomes unavailable to the websites residing on a server.
Let’s look at some causes:
- The web host has blocked SMTP – There are times (we will see some of them) when a hosting provider might need to block the protocol, port (25 by default), or both. But, whatever the reason, the only way to resolve the issue involves communicating with the hosting provider.
- WordPress hosting server misconfiguration – Web hosting providers do make mistakes. And, just maybe, they could have misconfigured the way their website or server uses the PHP mail() function. In this case, it is better to avoid manual handling of email and use a plugin instead.
- The SMTP host is blocking the emails – In some instances, SMTP servers like Gmail can block emails coming from a certain domain. This is usually caused by them thinking the emails themselves are spam or contain malicious content. This issue is resolved by contacting the hosting company.
- Misconfiguration of WordPress plugin – Perhaps, there is a configuration involving the wrong port number, security settings, or hostname. Oversights and mistakes are common occurrences and are usually resolved easily, as we shall soon see.
Let us now have a look at how these issues can be resolved.
How to test if SMTP is blocked by a host
A simple test to find out if the SMTP port has been blocked by the host is to use the Telnet network protocol and see if a connection can be made to the server via port 25 (or whichever port has been assigned).
To do so, exit to a command prompt and type:
Note: “examplehost.com” should be replaced by the domain name of your SMTP service provider.
Hit enter after the command.
Now, if you see a blank screen and the cursor blinking for a few seconds, then you have a successful connection – the port is open. You can move on to troubleshooting your plugin’s configuration.
But, if you see an error message that tells you the connection failed, you can assume that the port is either blocked. You should contact your email service provider and find out exactly what the issue is.
Here’s a video that explains these steps:
Alternatively, you can go through the Microsoft documentation for the protocol for a more in-depth understanding of using Telnet.
Reasons why a host might block SMTP
Hackers can take over a website and then use the host to send out spam mail or even malicious content.
This action could not only harm the recipients of the emails but also ruin the reputation of the hosting service provider by having their IP addresses blacklisted for spamming and sending out malicious content.
In case your website has been hacked, you may find that your hosting provider has blocked the SMTP protocol or the port used by the service. This blocking could be applied individually to your website or all the websites sharing the hosting server.
Some hosting providers may also temporarily block your email service until you have undergone a probation period during which they make sure that your new website is indeed a legitimate entity.
As we can see, these sorts of issues can only be resolved by working with the web or SMTP hosting providers.
Getting rid of PHP mail() issues
The first thing we need to understand here is that using the PHP mail() feature in itself poses a problem – it can’t be used in environments where there is a high traffic of email communication.
Besides, why would you want to choose the error-prone manual configuration of your email process when there are SMTP plugins out there that offer advanced features?
These plugins are also easy to set up, administer, and troubleshoot in case there are issues.
Get rid of the code, and install an SMTP plugin to save time, energy, and resources.
Avoiding misconfiguration of WordPress plugins
The best advice we can give you in this scenario is to prevent an SMTP plugin misconfiguration from occurring in the first place.
To that end, we will have a look at how to install and configure WP Mail SMTP – the most popular SMTP plugin that makes emailing a breeze.
Step by step installation of WP Mail SMTP
First, search and install the WP Mail SMTP plugin from the WordPress Directory.
Once you activate it, you will be directed to the first screen prompting you to “…Get Started.”
The next screen will ask you to select the SMTP mailer you will be using to send emails. There are many choices to select from including popular mailers like Gmail (which we will be using in this example), Amazon SES, 365/Outlook, and Zoho Mail.
Select Gmail and click on “Save and Continue” to proceed.
You will be forwarded to a popup informing you that the Gmail mailer should be used with websites that have a relatively low number of email traffic – which you should agree to before moving on.
Next, it is on to configuring the mailer settings by creating an email API in Google Cloud Platform (GCP). This step is relevant because it is a security step that authorizes WordPress, WP SMTP plugin, and Gmail to work seamlessly without putting anyone at risk.
You can find step-by-step instructions by reading how to create a Google API on the Google Cloud Platform.
Once you have set up the API you will have the Client ID and Client Secret that you can then fill in the text boxes below:
To fill in the “Authorized Redirect URI” click on the button on the right and it will automatically fill in the plugin’s default URI.
Click on “Connect to Google” to proceed.
You will now find yourself on the Gmail login screen asking you for the preferred account you would want to use with your website’s new email address.
You will need to agree to allow WP SMTP Mail to access your Google Account to continue.
Upon successful authorization, you will receive a popup informing you that you have successfully linked your website to your Gmail account via your Google API.
It is now time to configure what the “From” name will read when it is received by recipients and what email address should be used for them to reply to.
Next, you will be prompted to select email features that you want to enable. We are using the free version for this example, so all three features available – Improved Email Deliverability, Email Error Tracking, and Weekly Email Summary – are enabled by default.
For premium users with a license key, additional features – Detailed Email Logs and Manage Default Notifications – can also be enabled.
It is highly recommended that you always be kind enough to “Help Improve WP Mail SMTP” and receive helpful suggestions in return.
The next screen asks if you are a premium user with a license key to unlock advanced features. If so, you can enter it in the text box and click on “Connect.” Otherwise, you can skip this step and proceed.
The final step in the setup process is sending out a test email:
The test email will be sent to the configured email address and look something like this:
And that means you have successfully set up your SMTP email – Congratulations!
Why is WP Mail SMTP the best solution for blocked SMTP issues?
Now that you have set up your email, you’re probably wondering why we chose the WP Mail SMTP plugin as a way to overcome issues caused by a misconfiguration.
Well, it is the best solution because it comes with features like:
- Quick and uncomplicated setup that allows you to have your email up and running in a matter of minutes.
- Easy integration with numerous email service providers.
- Configurations that allow website owners to have absolute control over alerts, tracking, and audit trails of email traffic.
- A tiny digital footprint that doesn’t affect the performance of the website.
- Detailed documentation to help anyone – be they novice or pro – configure their plugin properly.
- Security features that help prevent your website from being hacked or used as a spoofing or spamming domain.
As you have seen, with WP Mail SMTP you can correctly configure your SMTP plugin and avoid any blockage.
Recap – The steps to handle blocked SMTP issues
Let us review the best ways to handle a blocked SMTP:
- First, make sure it is indeed blocked by your web host and, if so, communicate with them to resolve the issue.
- Find out if you have any PHP mail() issues and get rid of them by removing the code. Install WP Mail SMTP, configure it, and enjoy a peaceful emailing experience.
- If you also have a clunky or bug-filled plugin that is a drain on your resources, and patience, you can go ahead and replace it with WP Mail SMTP.
Your website will have a trusted email address, it will be safe from attacks, and you will also have an advanced email management tool at your disposal.
We hope this article helped you tackle your blocked SMTP. If so, and now that you have your email up and running, we think you would be interested in how to add posts to your WordPress blog by sending emails.
If you still have issues with blocked SMTP, though, we would like to help – contact us today.