# Unable to connect to O365 Mail Server

**URL:** <https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586>\
**Category:** ℹ️ Support\
**Created:** [April 28, 2020, 1:55pm UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586 "2020-04-28T13:55:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![infotechRichter](https://help.nextcloud.com/letter_avatar/infotechrichter/32/6_22734026db12803ebb3e059622ac3534.png) [@infotechRichter](https://help.nextcloud.com/u/infotechRichter)\
**Post date:** [April 28, 2020, 1:55pm UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/1 "2020-04-28T13:55:43Z")

</div>

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](http://smtp.office365.com:587)

Error: Connection could not be established with host [smtp.office365.com](http://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.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [April 30, 2020, 8:25am UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/2 "2020-04-30T08:25:22Z")

</div>

It’s a problem with the certificate of the mail server. Did you try the option STARTTLS for encryption ([Basic mail settings for 0365](https://help.nextcloud.com/t/basic-mail-settings-for-0365/57746/4))

---

<div class="post-metadata">

**Author:** ![infotechRichter](https://help.nextcloud.com/letter_avatar/infotechrichter/32/6_22734026db12803ebb3e059622ac3534.png) [@infotechRichter](https://help.nextcloud.com/u/infotechRichter)\
**Post date:** [April 30, 2020, 10:10am UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/3 "2020-04-30T10:10:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [April 30, 2020, 10:51am UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/4 "2020-04-30T10:51:27Z")

</div>

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/](https://blog.mailtrap.io/starttls-ssl-tls/)

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 6:38am UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/5 "2024-12-12T06:38:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 6:38am UTC](https://help.nextcloud.com/t/unable-to-connect-to-o365-mail-server/79586/6 "2024-12-12T06:38:16Z")

</div>


