Title: Peer Certificate error
Last modified: April 13, 2021

---

# Peer Certificate error

 *  Resolved [lewishackfath](https://wordpress.org/support/users/lewishackfath/)
 * (@lewishackfath)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/peer-certificate-error/)
 * Hello I recently moved my site to a new server and cannot send mail using smtp
   mailer any longer I get the following error:
 *     ```
       Versions:
       WordPress: 5.7
       WordPress MS: No
       PHP: 7.4.16
       WP Mail SMTP: 2.7.0
   
       Params:
       Mailer: smtp
       Constants: Yes
       ErrorInfo: SMTP Error: Could not connect to SMTP host.
       Host: smtp.office365.com
       Port: 587
       SMTPSecure: tls
       SMTPAutoTLS: bool(true)
       SMTPAuth: bool(true)
   
       Server:
       OpenSSL: OpenSSL 1.1.1d 10 Sep 2019
   
       Debug:
       Mailer: Other SMTP SMTP Error: Could not connect to SMTP host.
   
       SMTP Debug:
       2021-04-13 16:11:51 Connection: opening to smtp.office365.com:587, timeout=300, options=array()
        2021-04-13 16:11:51 Connection: opened
        2021-04-13 16:11:51 SERVER -> CLIENT: 220-hit-aws-web01.hitmediasolutions.com.au ESMTP Exim 4.94 #2 Wed, 14 Apr 2021 02:11:51 +1000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
        2021-04-13 16:11:51 CLIENT -> SERVER: EHLO lewis.hackfath.com
        2021-04-13 16:11:51 SERVER -> CLIENT: 250-hit-aws-web01.hitmediasolutions.com.au Hello lewis.hackfath.com [172.31.31.24]250-SIZE 52428800250-8BITMIME250-PIPELINING250-X_PIPE_CONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
        2021-04-13 16:11:51 CLIENT -> SERVER: STARTTLS
        2021-04-13 16:11:51 SERVER -> CLIENT: 220 TLS go ahead
        2021-04-13 16:11:51 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=‘hit-aws-web01.hitmediasolutions.com.au' did not match expected CN=‘smtp.office365.com' [/home/hackfath/public_html/lewis/wp-includes/PHPMailer/SMTP.php line 467]
        SMTP Error: Could not connect to SMTP host.
        2021-04-13 16:11:51 CLIENT -> SERVER: QUIT
        2021-04-13 16:11:51 
        2021-04-13 16:11:51 
        2021-04-13 16:11:51 Connection: closed
        SMTP Error: Could not connect to SMTP host
       ```
   
    -  This topic was modified 4 years, 12 months ago by [lewishackfath](https://wordpress.org/support/users/lewishackfath/).

Viewing 1 replies (of 1 total)

 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/peer-certificate-error/#post-14326465)
 * Hi [@lewishackfath](https://wordpress.org/support/users/lewishackfath/),
 * The error log indicates an issue with the certificate your server presented. 
   It looks like you’re trying to connect to Office 365 but SMTP traffic redirected
   to hitmediasolutions.com.au and so the hostname do not match the certificate.
   Please contact your webhost with the debug log and they’ll be able to fix the
   issue.
 * I hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Peer Certificate 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/peer-certificate-error/#post-14326465)
 * Status: resolved