Issue during sent an allert notification to 587

Hello all,
It is the first time I write in this forum…
I’m a recent user of docker and i’m trying to run prometheus and alertmanager under docker,
under two different version of ubuntu.

Under ubuntu 20:04.5 LTS running under Virtual box no issues, the email was sent without problems.

Under Ubuntu 22.04.1 LTS every time an issue apperas, the alert manage try to send an email but following error compares:

level=error ts=2023-02-16T14:12:42.570Z caller=dispatch.go:354 component=dispatcher msg=“Notify for alerts failed” num_alerts=1 err=“mail/email[0]: notify retry canceled after 2 attempts: send STARTTLS command: read tcp> read: connection reset by peer”

I tried a telnet connection (telnet 587) from alertmanager docker and it works well
as you can see

/alertmanager # telnet “smtp dot gmail dot com” 587
Connected to "smtp dot gmail dot com
220 ESMTP k12-20020a1709061c0c00b008b17aae2a01sm104153ejg.86 - gsmtp
/alertmanager #
/alertmanager #

Any suggestion about this issue?

Many thanks to all in advance.