Nextcloud 24.0.1 openssl wrong version

if you do sudo openssl s_client -connect nextcloud.example.com:25 -tls1_2 it will give you the following message:

CONNECTED(00000003)
40B7C293337F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:…/ssl/record/ssl3_record.c:354:

no peer certificate available

No client certificate CA names sent

SSL handshake has read 5 bytes and written 216 bytes
Verification: OK

New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1653394363
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no

When you do a basic setting and if you use smtp-relay.sendinblue.com and if you set the startls port to 587, you would have an openssl error that said something like wrong version (the same as the above example). The solution is to set to port 465 the problem will go away.

This solution also works with Netxcloud 25.0.7 and smtp.ionos.de as mail server!
That means port 465 instead of 587