# Unable to connect to the SMTP server through TLS

**URL:** <https://forum.mattermost.com/t/unable-to-connect-to-the-smtp-server-through-tls/24649>\
**Category:** Troubleshooting\
**Created:** [July 23, 2025, 7:08pm UTC](https://forum.mattermost.com/t/unable-to-connect-to-the-smtp-server-through-tls/24649 "2025-07-23T19:08:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmirHosseinKarimi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amirhosseinkarimi/32/9077_2.png) [@AmirHosseinKarimi](https://forum.mattermost.com/u/AmirHosseinKarimi)\
**Post date:** [July 23, 2025, 7:08pm UTC](https://forum.mattermost.com/t/unable-to-connect-to-the-smtp-server-through-tls/24649/1 "2025-07-23T19:08:27Z")

</div>

**Summary**  
Unable to connect to the SMTP server through TLS

**Steps to reproduce**  
SMTP Settings:

```auto
    "EmailSettings": {
        "EnableSignUpWithEmail": true,
        "EnableSignInWithEmail": true,
        "EnableSignInWithUsername": true,
        "SendEmailNotifications": false,
        "UseChannelInEmailNotifications": false,
        "RequireEmailVerification": false,
        "FeedbackName": "",
        "FeedbackEmail": "",
        "ReplyToAddress": "",
        "FeedbackOrganization": "",
        "EnableSMTPAuth": true,
        "SMTPUsername": "emailapikey",
        "SMTPPassword": " ************",
        "SMTPServer": "smtp.zeptomail.eu",
        "SMTPPort": "587",
        "SMTPServerTimeout": 10,
        "ConnectionSecurity": "TLS",
        "SendPushNotifications": true,
        "PushNotificationServer": "https://push-test.mattermost.com",
        "PushNotificationContents": "full",
        "PushNotificationBuffer": 1000,
        "EnableEmailBatching": false,
        "EmailBatchingBufferSize": 256,
        "EmailBatchingInterval": 30,
        "EnablePreviewModeBanner": true,
        "SkipServerCertificateVerification": false,
        "EmailNotificationContentsType": "full",
        "LoginButtonColor": "#0000",
        "LoginButtonBorderColor": "#2389D7",
        "LoginButtonTextColor": "#2389D7"
    }

```

Test connection.

**Observed behavior**  
`2025-07-23T19:03:47.429471655Z {"timestamp":"2025-07-23 19:03:47.428 Z","level":"error","msg":"Connection unsuccessful: unable to connect to the SMTP server through TLS: tls: first record does not look like a TLS handshake","caller":"web/context.go:123","path":"/api/v4/email/test","request_id":"eq74tc4dsj83mqt4gxmgaxj88r","ip_addr":"10.0.1.2","user_id":"h3i6go5refbd5m4stwi571jiwh","method":"POST","err_where":"testEmail","http_code":500,"error":"testEmail: Connection unsuccessful: unable to connect to the SMTP server through TLS: tls: first record does not look like a TLS handshake"}`

I’m 100% sure that SMTP credentials are correct and it worked on other apps.  
Is there anyway to get more details from logs? something like high level verbosity?

---

<div class="post-metadata">

**Author:** ![rtfm98](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rtfm98](https://forum.mattermost.com/u/rtfm98)\
**Post date:** [July 27, 2025, 10:17am UTC](https://forum.mattermost.com/t/unable-to-connect-to-the-smtp-server-through-tls/24649/2 "2025-07-27T10:17:01Z")

</div>

> [@AmirHosseinKarimi](#):
>
> “ConnectionSecurity”: “TLS”,`

Did you try “STARTTLS” instead of “TLS”?
