• Resolved eugene212

    (@eugene212)


    For some reason the mail test fails if option is set to TLS (port 587), but works fine with option SSL (port 465) – all other settings are the same including authentication credentials. Also TLS connection on port 587 is working fine when using some other mail clients, i.e. Thunderbird, etc.

    I can continue using SSL at port 465, but I would prefer to use TLS at 587 and I am at a loss how it can be fixed – probably there is some simple way to fix it, please advise.

    Here is the failed attempt log:

    Versions: WordPress: 5.5.1 WordPress MS: No PHP: 7.4.10 WP Mail SMTP: 2.4.0

    Params: Mailer: smtp Constants: No ErrorInfo: SMTP Error: Could not connect to
    SMTP host. Host: smtp.nuramed.ru Port: 587 SMTPSecure: tls SMTPAutoTLS:
    bool(true) SMTPAuth: bool(true)

    Server: OpenSSL: OpenSSL 1.0.2k 26 Jan 2017 Apache.mod_security: No

    Debug: Mailer: Прочие SMTP SMTP Error: Could not connect to SMTP host.

    SMTP Debug:

    2020-09-21 02:28:26 Connection: opening to smtp.domain-name:587, timeout=300,
    options=array()

    2020-09-21 02:28:26 Connection: opened

    2020-09-21 02:28:26 SERVER -> CLIENT: 220 thokk.from.sh

    2020-09-21 02:28:26 CLIENT -> SERVER: EHLO domain-name

    2020-09-21 02:28:26 SERVER -> CLIENT: 250-thokk.from.sh Hello domain-name
    [x.x.x.x]250-SIZE 52428800250-8BITMIME250-AUTH PLAIN LOGIN250-STARTTLS250
    HELP

    2020-09-21 02:28:26 CLIENT -> SERVER: STARTTLS

    2020-09-21 02:28:26 SERVER -> CLIENT: 220 TLS go ahead

    2020-09-21 02:28:26 Connection failed. Error #2: stream_socket_enable_crypto():
    Peer certificate CN=from.sh' did not match expected CN=smtp.domain-name’
    […/public_html/wp/wp-includes/PHPMailer/SMTP.php
    line 426]

    SMTP Error: Could not connect to SMTP host.

    2020-09-21 02:28:26 CLIENT -> SERVER: QUIT

    2020-09-21 02:28:26

    2020-09-21 02:28:26

    2020-09-21 02:28:26 Connection: closed

    SMTP Error: Could not connect to SMTP host.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @eugene212,

    The error indicates the issue with the SSL certificate your server is presenting. Please contact your hosting provider to fix the mail server or disable the SSL verification using custom codes, but it’s compromising your security. You can follow this documentation to add custom codes to your site.

    I hope this helps!

    Thread Starter eugene212

    (@eugene212)

    Hi @sanzeeb3,

    Thanks for the information, but why then the option of “SSL / port 465” is working ?
    Are there different SSL certificates for different connections ?
    Also I don’t have issues if sending email via TLS/587 with AUTH LOGIN using completely different mail client software.

    Any additional insight is appreciated !

    HI @eugene212,

    Thanks for the additional information. The certificate mismatch error can also result when some firewall on your server transparently redirects the SMTP traffic on that port 587 to its own server and so the hostname doesn’t match the certificate the server presented, which means they don’t want you to connect to external mail servers than their own. For example, you’re trying to connect to smtp.nuramed.ru but ended up connecting to own host for example smtp.domain-name.

    When you get a chance, could you please let me know what mail client you’re using have the issue and which one does not? In anyway, you should contact your host and fix the issue with configuration.

    Thanks!

    Thread Starter eugene212

    (@eugene212)

    Hi @sanzeeb3,

    Please see below more information:

    1. smtp.nuramed.ru is the mail server of my host.
    2. I can successfully send emails using above SMTP server with TLS on port 587 from my Delphi based program (uses ICS SMTP Component V2.55).
    3. “WP Mail SMTP” plugin fails sending test email using the same settings/credentials/SMTP server.

    The fact that I can send emails (as in p.2) seems to confirm that my host SMTP server is working properly.

    Any other ideas/thoughts please ?

    Hi @eugene212,

    Thanks for getting in touch. If you’re getting that error with the mail server of your host, it’s pretty much the misconfiguration with your certificate. I suggest you to test by disabling the SSL verification. Here’s the tutorial on adding custom codes.

    Please let me know how it goes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SMTP test mail fails with TSL option (works with SSL)’ is closed to new replies.