SOLVED: TLS Negotiation failed, the certificate doesn't match the host (GMAIL)

Hello to everybody.
I was having problems sending emails (with my domain) via Gmail.
Before cloudflare the email worked fine, but after configuration stop sending mails.

I’ve looked for solutions for days and none of the topics here explain how to make it work, it was frustrating.
Until I finally found a solution that I want to share to everyone who has the same problem.

SOLUTION

  1. Login to your cpanel account

  2. Copy the shared server host name from the cPanel URL. Host name is between https:// and :2083/ so in this example case the correct host name would be n3plcpnl0082.prod.ams3.secureserver.net, like it’s shown on the next image:
    1 — ImgBB

  3. Paste the host name to Gmail settings Accounts and Import/Send mail as/edit info/SMTP Server and click Save Changes, like this: 2 — ImgBB

And that’s all! Enjoy.

May I suggest looking into below article as far as if you added your domain name to Cloudflare, it’s obviously your A mail record was set to :orange: (proxied) instead of :grey: (DNS-only) at the DNS tab of Cloudflare dashboard for your domain name and possible MX record was not pointed to that unproxied mail.yourdomain.com hostname:

Furthermore, your Gmail could be possibly configured to use domain.com (proxied hostname) instead mail.domain.com (unproxied hostname) for sending/receiving server too.

Here is an article providing step-by-step instructions including screenshots how to properly setup and configure your e-mail to make sure it works while using Cloudflare for your domain name:

Not really, I would not recommend doing it that way.

I am sorry to hear that, but I am afraid maybe you haven’t done some step which was needed in the process. (see my articles from above)