Connect Exchange Online to hosted Nextcloud

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Hub 10 | 31.0.10
  • PHP version (e.g, 8.3):
    • 8.3.27
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Hetzner StorageShare

So at the moment i’m playing around with Nextcloud.

I bought a Storage Share “nextcloud” at Hetzner.

Everthing is set up except Mail.

How do I connect Exchange Online to my hosted Nextcloud?

Right now I’m in the Basic settings and these are my Email server settings:

Send mode: SMTP

Encryption: None/Starttls

From address: nextcloud@domain.de

Server address: smtp.office365.com:587

Authentication: yes

Username and Password of the Shared Mailbox

I want that the Share Links and Password get send from my Domain and not from the Hetzner Mail Server.

Is it possible to connect Nextclodu to Exchange Online?

Thank you.

Hetzner normally blocks outgoing SMTP unless you request to get this allowed (there is a “limits” section in the Hetzner console where you can request to get SMTP enabled). This is their way to avoid too much spam getting sent from their network.

Depending on the configuration the Exchange server needs to be reconfigured to accept SMTP and POP3/IMAP from external clients.

So with the Help of Hetzner I have follwing info:

Failed to authenticate on SMTP server with username \\\“nxtcloud@xxx.de\\\”

using the following authenticators: “LOGIN”, “XOAUTH2”

535 5.7.139 Authentication unsuccessful, basic authentication is disabled.

[FR4P281CA0212.DEUP281.PROD.OUTLOOK.COM 2026-01-27T14:27:52.430Z 08DE5D0DD7D2282B]

I saw that there where change made on Nextcloud around 2023 to support Oauth2 for Google and Microsoft but that seems just for User Accounts.

But I want to add Mailbox / Shared Mailbox in the Settings that the Mail will get sent from that Mail and not from a Users E-Mail Address.