Unable to connect to O365 Mail Server

Hello Community,

i’m trying to connect my Nextcloud Server with an Office365 account.
I’m sure the server configuratins for the mail server are correct, but i’m getting an SSL Error and can’t handle it.

configuration:
SMTP; SSL/TSL
smtp.office365.com:587

Error: Connection could not be established with host smtp.office365.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)

The SSL Server Test for the Domain has been rated with A+.

Thank you for your help.

It’s a problem with the certificate of the mail server. Did you try the option STARTTLS for encryption (Basic mail settings for 0365)

Thank you very much, it worked with STARTTLS, but it is not too risky to use it all the time?

STARTTLS eventually uses an encrypted connection as well. It is used for ports that can theoretically be used with or without encryption. With STARTTLS, the client makes sure to use encryption, more info: https://blog.mailtrap.io/starttls-ssl-tls/