• Resolved semesta

    (@semesta)


    I’ve tried to setup WP MAIL SMTP but I failed when I sent email test. First, I thought my email smtp is configured wrong, but it doesn’t. I try my email smtp using gmass.co/smtp-test to send email, and it worked.

    Here is the error log from WP MAIL SMTP:

    Versions:
    WordPress: 6.2.2
    WordPress MS: No
    PHP: 8.0.29
    WP Mail SMTP: 3.8.0
    
    Params:
    Mailer: smtp
    Constants: No
    ErrorInfo: SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=server.hostingxxxx.id' did not match expected CN=mail.xxxxx.my.id'SMTP server error: QUIT command failed Detail: H;?e'?U@??LY?M221 server.hostingxxxx.id closing connection
    Host: mail.xxxxx.my.id
    Port: 587
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true)
    
    Server:
    OpenSSL: OpenSSL 3.0.2 15 Mar 2022
    
    Debug:
    Email Source: WP Mail SMTP
    Mailer: Other SMTP
    SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server
    
    SMTP Debug:
    2023-06-23 09:44:20 Connection: opening to mail.xxxxx.my.id:587, timeout=300, options=array()
    
    2023-06-23 09:44:20 Connection: opened
    
    2023-06-23 09:44:20 SERVER -> CLIENT: 220 server.hostingxxxx.id ESMTP Exim 4.96-58-g4e9ed49f8 Fri, 23 Jun 2023 16:40:35 +0700
    
    2023-06-23 09:44:20 CLIENT -> SERVER: EHLO rm4.xxxxx.my.id
    
    2023-06-23 09:44:20 SERVER -> CLIENT: 250-server.hostingxxxx.id Hello ec2-108-136-174-232.ap-southeast-3.compute.amazonaws.com [108.136.174.232]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPECONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
    
    2023-06-23 09:44:20 CLIENT -> SERVER: STARTTLS
    
    2023-06-23 09:44:20 SERVER -> CLIENT: 220 TLS go ahead
    
    2023-06-23 09:44:20 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=server.hostingxxxx.id' did not match expected CN=mail.xxxxx.my.id' [/home/sakti4/htdocs/rm4.xxxxx.my.id/wp-includes/PHPMailer/SMTP.php line 468]
    
    SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=server.hostingxxxx.id' did not match expected CN=mail.xxxxx.my.id'
    
    2023-06-23 09:44:20 CLIENT -> SERVER: QUIT
    
    2023-06-23 09:44:21
    
    2023-06-23 09:44:21
    
    2023-06-23 09:44:21 Connection: closed
    
    SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=server.hostingxxxx.id' did not match expected CN=mail.xxxxx.my.id'
    
    

    And this is log from gmass.co that can succesfully sent email:

    Connected to smtp://mail.xxxxx.my.id:587/?starttls=when-available
    << 220 server.hostingxxxx.id ESMTP Exim 4.96-58-g4e9ed49f8 Fri, 23 Jun 2023 16:51:26 ?
    >> EHLO [172.31.11.248]
    << 250-server.hostingxxxx.id Hello ec2-54-212-131-181.us-west-2.compute.amazonaws.com [54.212.131.181]
    << 250-SIZE 52428800
    << 250-8BITMIME
    << 250-PIPELINING
    << 250-PIPECONNECT
    << 250-AUTH PLAIN LOGIN
    << 250-STARTTLS
    << 250 HELP
    >> STARTTLS
    << 220 TLS go ahead
    >> EHLO [172.31.11.248]
    << 250-server.hostingxxxx.id Hello ec2-54-212-131-181.us-west-2.compute.amazonaws.com [54.212.131.181]
    << 250-SIZE 52428800
    << 250-8BITMIME
    << 250-PIPELINING
    << 250-PIPECONNECT
    << 250-AUTH PLAIN LOGIN
    << 250 HELP
    >> AUTH PLAIN AHJlc3RvQG1lc3RhLm15LmlkAFNhdWRhcmExOTc=
    << 235 Authentication succeeded
    >> MAIL FROM:<[email protected]> SIZE=553
    >> RCPT TO:<[email protected]>
    << 250 OK
    << 250 Accepted
    >> DATA
    << 354 Enter message, ending with "." on a line by itself
    >> From: [email protected]
    >> Date: Fri, 23 Jun 2023 09:55:02 ?
    >> Subject: SMTP test from mail.xxxxx.my.id
    >> Message-Id: <WPWDMTN1AKU4.HEUW1XVE86S1@WIN-AUIR3RRGP88>
    >> To: [email protected]
    >> MIME-Version: 1.0
    >> Content-Type: multipart/alternative; boundary="=-ZuQxxxIIopOhikWJTpMMjQ=="
    >>
    >> --=-ZuQxxxIIopOhikWJTpMMjQ==
    >> Content-Type: text/plain; charset=utf-8
    >>
    >> Test message
    >> --=-ZuQxxxIIopOhikWJTpMMjQ==
    >> Content-Type: text/html; charset=utf-8
    >> Content-Id: <WPWDMTN1AKU4.XKPFA7SEEFPM2@WIN-AUIR3RRGP88>
    >>
    >> <b>Test message</b>
    >> --=-ZuQxxxIIopOhikWJTpMMjQ==--
    >> .
    << 250 OK id=1qCdRw-009CQZ-2x

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darshana

    (@darshanaw)

    Hi @semesta,

    Thanks for reaching out! The error log indicates that you have experienced an issue related to the server certificate. Basically, the current certificate does not match the hostname you’ve configured.

    Please contact your hosting/email provider with the full SMTP error log and they should be able to assist you further.

    I hope this helps. Thanks!

    Thread Starter semesta

    (@semesta)

    Thanks for reply @darshanaw !

    I don’t think the problem is on my email provider, because I’ve tried using another smtp plugin (post smtp) and it worked just fine. But if it can be solved, I love to use wp mail smtp more.

    Thanks! And I will still try to contact my email provider

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Failed to send email test’ is closed to new replies.