IT in Education

Configure Nextcloud to use SMTP mail services

nextcloudBy default Nextcloud is configured to use PHP for sending its email notifications. This can cause problems with email being filtered and not arriving in inboxes. This article describes how to setup SMTP mail services for Google services with Nextcloud 21.


Nextcloud Admin

Start by logging on to your Nextcloud instance using an admin account.

  1. Click your image (top-right) and choose Settings from the drop-down list.
  2. Select Basic settings in the left pane.
  3. In the Email server section:
    1. For Send mode choose SMTP
    2. For Encryption select SSL/TLS
    3. For the From address enter This email address is being protected from spambots. You need JavaScript enabled to view it.
    4. For Authentication method select Login.
    5. Click the checkbox for Authentication required.
    6. Server address: smtp.gmail.com, with Port 465.
    7. Enter your SMTP user account's Credentials (e.g. This email address is being protected from spambots. You need JavaScript enabled to view it.) and password.
    8. Click Store credentials button, to save your user account details.
  4. Click Send email to test your settings. This should now send an email from This email address is being protected from spambots. You need JavaScript enabled to view it. to the email address that you've configured for your Admin account.

Note that if you are using Gmail, you might need to Allow less secure apps for this account.

config.php

Alternatively you can edit your config/config.php file directly, or for a more consistent configuration you can create your own mail.config.php file.

Spam check

When using donotreply email accounts, it's a good idea to configure SPF, DKIM and DMARC to reduce the spaminess of your account. You can then be more confident that your system emails will arrive at their destinations.


Thanks for visiting,
Steven