Nextcloud email server settings for Microsoft 365 and Gmail
Nextcloud sends email for password resets, sharing notifications, activity summaries, and calendar invitations through a single SMTP server. It signs in to this server with a username and password, and has no OAuth option, so it can’t use Microsoft 365 or Gmail directly.
With Auth-Email, you only change the server, port, and password – on the Basic settings page, or in config.php.
💡 This guide is for Nextcloud’s own system email. The separate Mail app, which each user can use to read their own email, has its own Microsoft and Google sign-in options.
Before you start: link the mailbox in your Auth-Email dashboard, and choose a password for it. That is the password you’ll enter in Nextcloud – not your mailbox password.
For a shared address, see account delegation and shared mailboxes.
Step 1: Configure Nextcloud’s email server
Sign in to Nextcloud as an administrator, open Administration settings, and choose Basic settings. In the Email server section, enter the following. Show the settings for an account provided by Outlook:
- Send mode:
SMTP - Encryption:
SSL - From address: The linked mailbox’s address, split into the part before the @ and the domain
- Server address:
outlook.auth-email.com, and port465 - Authentication: Ticked (Authentication required)
- Credentials: The linked mailbox’s full email address (e.g.,
you@outlook.com) as the SMTP Login, and the password you chose in Auth-Email as the SMTP Password
Click Save, and then Send email to send a test message to your own address. (Your own email address must be set in your Personal info settings first.)
Using config.php instead
If you prefer, you can add the same settings to Nextcloud’s config/config.php file:
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_smtphost' => 'outlook.auth-email.com', // the server shown in your Auth-Email dashboard
'mail_smtpport' => 465,
'mail_smtpauth' => true,
'mail_smtpname' => 'nextcloud@yourdomain.com', // the linked mailbox's address
'mail_smtppassword' => 'your-auth-email-password',
'mail_from_address' => 'nextcloud', // the part before the @
'mail_domain' => 'yourdomain.com',
Troubleshooting
- “Authentication failed” or “Expected response code 235”: check that the SMTP Login is the full email address, and that the password is the one you chose in Auth-Email (not your mailbox password)
- Connection times out: check that Encryption is SSL with port
465, and that your Nextcloud server can make outgoing connections on that port. Some hosting providers block outgoing email ports “Sender address rejected” or “SendAsDenied”: the From address must be the linked mailbox, or an address that the mailbox is allowed to send as
Notification emails are delayed: Nextcloud sends many emails from background jobs, so check that its cron job is running (Administration settings > Basic settings > Background jobs)
For other errors, such as Microsoft 365 reporting that SMTP AUTH is disabled, see fixing common errors. Your account’s connection page in the Auth-Email dashboard also shows whether Nextcloud has connected, and explains any error it received. Still stuck? Email us – we’ll help you get it working.
Related articles
Try Auth-Email with Nextcloud
Link your mailbox, update Nextcloud’s email server settings, and send yourself a test message.
Start your free trial →No credit card needed. Check that it works, including sending yourself test messages, before you pay.