Title: Another SMPT connect error
Last modified: April 1, 2020

---

# Another SMPT connect error

 *  Resolved [canadabri](https://wordpress.org/support/users/canadabri/)
 * (@canadabri)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/)
 * I have an intranet WP site. We are using MS Exchange, and our CA is a our ow 
   microsoft server. Unfortunately I cannot give access.
 * Email servers are working fine… I can connect to webmail and such in my browser.
 * I cannot get the WP Mail SMTP to connect though. My intranet site does not (yet)
   use SSL. My MSExchange servers do.
 * This is the relevant part of the debug log:
    `Connection failed. Error #2: stream_socket_enable_crypto():
   SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:
   tls_process_server_certificate:certificate verify failed [E:\www\*******\wp-includes\
   class-smtp.php line 374]`
 * Any ideas what might be going on?
 * Full log (masked out parts for privacy)
 *     ```
       Versions:
       WordPress: 5.3.2
       WordPress MS: No
       PHP: 7.3.12
       WP Mail SMTP: 1.9.0
   
       Params:
       Mailer: smtp
       Constants: No
       ErrorInfo: SMTP Error: Could not connect to SMTP host.
       Host: <<mail server name>>.<<domain name>>.ca
       Port: 587
       SMTPSecure: tls
       SMTPAutoTLS: 
   
       E:\www\*******\wp-content\plugins\wp-mail-smtp\src\Debug.php:111:boolean true
   
       SMTPAuth: 
       E:\www\*******\wp-content\plugins\wp-mail-smtp\src\Debug.php:111:boolean true
   
       Server:
       OpenSSL: OpenSSL 1.1.1d  10 Sep 2019
       Apache.mod_security: No
       SMTP Debug:
       2020-04-01 15:25:22 Connection: opening to <<mail server name>>.<<domain name>>.ca:587, timeout=300, options=array ()
       2020-04-01 15:25:22 Connection: opened
       2020-04-01 15:25:22 SERVER -> CLIENT: 220 <<mail server name>>.<<domain name>>.ca Microsoft ESMTP MAIL Service ready at Wed, 1 Apr 2020 08:25:22 -0700
       2020-04-01 15:25:22 CLIENT -> SERVER: EHLO <<sitename>>.<<domain name>>.ca
       2020-04-01 15:25:22 SERVER -> CLIENT: 250-<<mail server name>>.<<domain name>>.ca Hello [***.***.***.***]250-SIZE 37748736250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-AUTH GSSAPI NTLM250-8BITMIME250-BINARYMIME250 CHUNKING
       2020-04-01 15:25:22 CLIENT -> SERVER: STARTTLS
       2020-04-01 15:25:22 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
       2020-04-01 15:25:34 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [E:\www\*******\wp-includes\class-smtp.php line 374]
       SMTP Error: Could not connect to SMTP host.
       2020-04-01 15:25:34 CLIENT -> SERVER: QUIT
       2020-04-01 15:25:34 SERVER -> CLIENT: 
       2020-04-01 15:25:34 SMTP ERROR: QUIT command failed: 
       2020-04-01 15:25:34 Connection: closed
       SMTP Error: Could not connect to SMTP host.
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/#post-12621522)
 * Hi [@canadabri](https://wordpress.org/support/users/canadabri/),
 * The error details indicate the issue with the certificate, or server misconfiguration.
   You can test with disabling the SSL verification with this [custom code](https://gist.github.com/slaFFik/c1d7d4249f47da7195fb973109952090),
   and consider fixing your mail server certificate.
 * Thanks!
 *  [marcoome](https://wordpress.org/support/users/marcoome/)
 * (@marcoome)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/#post-12633768)
 * Hey [@sanzeeb3](https://wordpress.org/support/users/sanzeeb3/),
 * where shout I implement that code?
 * Thank you! ☺️
 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/#post-12639096)
 * Hi [@marcoome](https://wordpress.org/support/users/marcoome/),
 * To easily add custom codes in your site, you can follow this [tutorial](https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/).
   Please note that this is compromising security and you should fix your mail server
   certificate.
 * Thanks!
 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/#post-12700562)
 * Hi [@canadabri](https://wordpress.org/support/users/canadabri/), [@marcoome](https://wordpress.org/support/users/marcoome/)–
   We haven’t heard from you in about a week, so I’m going to go ahead and mark 
   this ticket resolved. If you still have questions, though, please feel welcome
   to continue the conversation.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Another SMPT connect error’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/another-smpt-connect-error/#post-12700562)
 * Status: resolved