Help Center

Troubleshooting 'SMTP connect() Failed' Error with External SMTP Mail Providers: A Step-by-Step Guide

SMTP connect() failed error troubleshooting, Resolving SMTP connection issues with external providers, Troubleshooting SMTP connection errors for external SMTP service 1
Print

Symptom

When sending emails using an external SMTP mail provider (including Gmail™), a SMTP connect() failed error displays in WHMCS and appears in the Configuration > System Log:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
 
Validation Error: SMTP connect() failed.

If you have enabled SMTP Debug for your mail provider in the Mail tab at Configuration > System Settings > General Settings, the log entry will also include the following details:

SMTP Debug: Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array()

SMTP Debug: Connection failed. Error #2: stream_socket_client(): SSL  operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate  verify failed  [/path/to/whmcs/vendor/phpmailer/phpmailer/src/SMTP.php  line 375]

SMTP Debug: Connection failed. Error #2:  stream_socket_client(): Failed to enable crypto  [/path/to/whmcs/vendor/phpmailer/phpmailer/src/SMTP.php  line 375]

SMTP Debug: Connection failed. Error #2:  stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465  (Unknown error)  [/path/to/whmcs/vendor/phpmailer/phpmailer/src/SMTP.php  line 375]

SMTP Debug: SMTP ERROR: Failed to connect to server:  (0)

SMTP Debug: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
 

For more information about enabling SMTP Debug, see Email Sending Issues.

Cause

The server that hosts your WHMCS installation is blocking connections to the external SMTP server.

Solution

Adjust your mail server configuration to allow connections to external SMTP servers.

For steps to resolve this issue on the cPanel and Plesk control panels, see:

  • How to Disable SMTP Restrictions
  • Configuring Server-Wide Mail Settings

 

The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.

 

Was this answer helpful?

Still need a hand?

Our support team is on standby if this article didn't fully answer your question.

« Back