Mattermost Peer-to-Peer Forum

[solved] TLS Connection Error SendMail Failed to Open TLS - on SES Amazon SMTP credentials in Config/Mattermost JSON


I created an SES IAM for SMTP in AWS so MatterMost can use for Email. It has the correct permissions for SES and etc.

When i go to the Admin Matter Most Console and Test the credentials i get Connection Unsuccessful SendMail Failed to Open TLS connection tls first record does not like a TLS handshake.

I am using Port 587
Enabled SMTP Auth is set to true
SMTP username
SMTP Password (the SES secret)
Connection is TLS
SMTP server is

What is Wrong here ?

TLS Connection Error SendMail tls: first record does not look like a TLS handshake

Hi @drj,

Have you tried with port 465 as in the documentation:


I resolved it - what i did, was my AWS SES IAM (smpt) code was written in Terraform. The issue was, it was the wrong credentials because terraform had another set of credentials but i manually deleted the Access Key in AWS and manually added it and kept testing with wrong credentials.

Solved it by removing the Access Key manually from the IAM user i created for mattermost, re-ran Terraform Plan and Apply (gave me a new Access Key and Secret). Then ran terraform output to get the new access key and secret - used those creds and placed it in the mattermost config, kept port 587 by the way and changed it from TLS to STARTTLS - and tested the connection and all came through and worked ( emails were sent).

Thanks Again!

1 Like