Back to Community

Fixing the 'SMTP connect() failed' Error in Easy WP SMTP: A Comprehensive Guide

33 threads Sep 16, 2025

Content

If you've encountered the frustrating SMTP ERROR: Failed to connect to server message while setting up the Easy WP SMTP plugin, you're not alone. This is one of the most common issues users face when configuring SMTP for their WordPress site. This guide will break down what this error means and walk you through the most effective troubleshooting steps.

What Does the "SMTP connect() failed" Error Mean?

This error is generated by the PHPMailer library, which the plugin uses to handle email sending. It indicates that your WordPress site was unable to establish a network connection to the SMTP mail server you specified (e.g., smtp.gmail.com, smtp.office365.com, or your host's server). The specific error code in parentheses provides a clue:

  • (0), (110), Connection timed out: The server did not respond at all. Often a firewall, network, or DNS issue.
  • (111), Connection refused: The server was found but actively rejected the connection. Usually a port blocking or authentication configuration issue.
  • php_network_getaddresses: getaddrinfo failed: Name or service not known (0): The server hostname (e.g., smtp.gmail.com) could not be resolved to an IP address. This is typically a DNS or typo issue.

Most Common Causes and Solutions

1. Incorrect SMTP Settings

The most frequent cause is simply entering the wrong details for your email provider.

  • Check and Double-Check: Ensure the SMTP host, port, encryption type (SSL/TLS), username, and password are exactly as provided by your email service. A single typo is enough to cause a failure.
    • Gmail/Google Workspace: Host: smtp.gmail.com, Port: 587 (TLS) or 465 (SSL), Authentication: ON.
    • Office 365/Outlook: Host: smtp.office365.com, Port: 587, Encryption: STARTTLS (often labeled TLS), Authentication: ON.
  • App Passwords: For Gmail accounts with 2-Factor Authentication (2FA) enabled, you cannot use your regular password. You must generate a unique App Password and use that in the SMTP password field.
  • Less Secure Apps (Gmail): If you don't use 2FA, ensure "Less secure app access" is turned on in your Google Account settings. Note: Google is phasing out this option, so using an App Password is the recommended method.

2. Hosting Provider Restrictions

Many web hosts, including GoDaddy, Bluehost, and others, block outgoing SMTP connections to external mail servers on common ports (25, 465, 587) as a security measure. They often require you to use their SMTP servers instead.

  • Contact Your Host: This is a critical step. Reach out to your hosting provider's support and ask: "Are outbound SMTP connections to ports 465 and 587 allowed to external mail servers like Gmail? If not, what are your recommended SMTP settings?"
  • Use Host's SMTP: If they block external connections, you must use the SMTP server details provided by your host, not Gmail's or Office 365's.

3. Firewalls and Security Plugins

A firewall on your server or a security plugin on your WordPress site (e.g., Wordfence, Sucuri) could be blocking the outgoing connection.

  • Temporarily disable any WordPress security plugins to test if they are the cause.
  • Check your server's firewall rules (or contact your host to do this) to ensure outgoing traffic on your SMTP port is permitted.

4. Localhost and Development Environments

Sending email from a local server (like XAMPP or MAMP) is notoriously difficult because these environments are often not configured for SMTP and may be blocked by ISPs or email providers.

  • Consider using a mail testing plugin or a service like Mailtrap for development instead of trying to configure a live SMTP connection.

5. Recent Changes

If the plugin was working and suddenly stopped, ask yourself what changed:

  • Did your host change their firewall policies?
  • Did your email provider (e.g., Google) update their security requirements?
  • Did you update a plugin, theme, or WordPress core that might have caused a conflict?
  • Did you revoke an App Password or change your email password?

Summary: Your Action Plan

  1. Verify Settings: Triple-check your SMTP settings against your email provider's documentation.
  2. Use App Passwords: For Gmail with 2FA, generate and use an App Password.
  3. Contact Your Host: This is the most crucial step for errors like Connection timed out (110) and Connection refused (111). Inquire about SMTP restrictions.
  4. Check for Conflicts: Temporarily disable other plugins to rule out conflicts.

Remember, the 'Easy WP SMTP – WordPress SMTP and Email Logs' plugin relies on your server's ability to connect to the mail server. The error message almost always points to a configuration, network, or hosting policy issue rather than a bug in the plugin itself. By methodically working through these steps, you can identify and resolve the connection problem.

Related Support Threads Support