Skip to main content

How to Test Your SMTP Connection (And Fix Broken wp_mail)

Tom Morton

How to test your SMTP connection

If you just configured a new transactional email tool in WordPress but critical emails still aren’t sending, you likely ran into a connection error. Traditional plugins rely on opening ports from your web host to a third-party server like SendGrid or Google. This means dozens of factors can sever the connection.

Here is how to test your WordPress email connection and troubleshoot the most common failures.

1. Verify your connection port (465 vs 587)

The most common reason a standard SMTP plugin fails to send mail is that your web host is actively blocking outbound connections on the port you are trying to use.

  • Port 587 (TLS): This is the modern standard for secure email submission. However, cheap shared hosting providers often block this port to prevent their servers from being used to send spam.
  • Port 465 (SMTPS): This is an older, implicitly secure port. If Port 587 fails, attempting to connect via Port 465 is a common fallback.

Note: WPFlareMail bypasses this port friction. It securely transmits payloads to Cloudflare over standard HTTPS (Port 443), which is universally unblocked by web hosts.

2. Check for incorrect API keys or passwords

Authentication failures happen frequently when rotating keys or setting up application-specific passwords.

  • If you use Gmail, you cannot simply use your standard account password; you must generate an “App Password” specifically for the plugin.
  • If you use an API service, ensure the API key has not expired and explicitly has “Mail Send” permissions enabled within the provider’s dashboard.

3. Identify sender domain mismatches

Most reputable services will instantly kill a connection request if the “From Address” in WordPress does not match the verified domain on your provider’s account.

For instance, if your Mailgun account is authorized to send emails on behalf of yourdomain.com, but your WordPress global settings are trying to send the email from admin@gmail.com or info@anothersite.com, the connection will be rejected at the API level to prevent spoofing. Always ensure your “Force From Email” settings inside your email plugin match your authorized sending domain.

A frictionless alternative

Constantly fighting with connection timeouts, blocked ports, and API permissions is exactly why the architecture of generic SMTP plugins feels broken.

If you want to stop troubleshooting, WPFlareMail skips the legacy SMTP handshake entirely. By hooking your site directly into Cloudflare via HTTPS, your emails simply work.