Configuring a Server for Outgoing Mail

Configuring your Confluence server to send email messages allows your Confluence users to:

You can personalize email notifications by configuring the 'From' field to include the name and email address of the Confluence user who made the change.

You need System Administrator permissions in order to configure Confluence's email server settings.

Configuring Confluence to send email messages

To configure Confluence to send outgoing mail:

  1. Go to Administration menu , then General Configuration > Mail Servers. This will list all currently configured SMTP servers.
  2. Click Add New SMTP Server (or edit an existing server).
  3. Under SMTP server details, edit the following fields as required:
    • Name: By default, this is simply 'SMTP Server'.
    • From Address: Enter the email address that will be displayed in the 'from' field for email messages originating from this server.
      This field is mandatory. This must be an ordinary email address, you can't enter variables in this field. 
    • From Name: Enter the name that will be displayed in the 'from' field for email messages originating from this server. This is the text which appears before the user's registered email address (in square brackets).
      This field accepts the following variables, which reference specific details defined in the relevant Confluence user's profile:

      Variable

      Description

      ${fullname}

      The user's full name.

      ${email}

      The user's email address.

      ${email.hostname}

      The domain/host name component of the user's email address.

      The default is '${fullname} (Confluence)'.
      Hence, if Joe Bloggs made a change to a page he was watching and the Confluence site's 'From Address' was set to confluence-administrator@example-company.com, then the 'From' field in his email notification would be: Joe Bloggs (Confluence) <confluence-administrator@example-company.com>.

    • Subject Prefix: Enter some text to appear at the beginning of the subject line.
  4. Either configure the server hostname or specify the JNDI location.

Configure server hostname

  1. Under Server hostname, complete the fields using the following table as a guide.
    FieldDescription 
    Server hostname

    Specify the hostname or IP address of your SMTP mail server.

    Below are the mail server settings for Google and Microsoft:

    Protocol

    Select whether your Outbound mail server uses a standard SMTP or secure SMTPS protocol.

    To use the OAuth 2.0 integration as your authorization method, select a secure protocol.

    Server port

    This is the port that will be used to retrieve mail from your SMTP account. When you select a protocol, the port will be changed to the default value. The defaults are:

    • SMTP: 25
    • SMTPS: 465

    You may specify your own custom port.

    Authorization

    Select a way to authenticate to the mail server. The default value is Basic Authentication.

    To use the OAuth 2.0 authorization method here, you will need to first configure Confluence as an OAuth 2.0 client in Application links. Learn how to configure an outgoing link with some notes below: 

    • If Microsoft is the external provider, the following scopes must be entered in the Scopes field:
    • If Google is the external provider, https://mail.google.com is the only scope required
    User nameThis is the username used to authenticate your mail account.
    Password

    This field is only required if you are using basic authentication.

    This is the password for your mail account.

    Use TLSIf your SMTP host uses the Transport Layer Security (TLS) protocol select Use TLS. 
  2. Once completed, select Authorize. You will be redirected to your service provider's site to log in to your account and authorize the connection. After the connection is authorized successfully, you will be redirected back to your app.
  3. Select Submit to save the new mail server. If you forget to select Submit, the mail server configuration will not be saved even after its connection is authorized.

Specify the JNDI location

Specify the JNDI location of a mail session configured in your application server. For more information on how to set up a JNDI mail session, see Setting Up a Mail Session for the Confluence Distribution.

If you set up OAuth authorization as described in the previous section, it will override the JNDI authorization.

Testing the email settings

A Confluence administrator can test the email server as follows:

  1. Set up a mail server as described above.
  2. Click Send Test Email to check that the server is working. Check that you get the test email in your inbox.
  3. You can flush the email queue to send the email message immediately. Go to Mail Queue, and click Flush Mail Queue. See The Mail Queue.

A user can test that notifications are working as follows:

  1. Go to your user profile (using the Settings link) and edit your email preferences. See Email Notifications.
  2. Enable Notify On My Actions. (By default, Confluence does not send you notifications for your own changes.)
  3. Go to a page you wish to get notifications about.
  4. Choose Watch at the top-right of the page. See Watch Pages, Spaces and Blogs.
  5. Edit the page, make a change, and save the page.
  6. Check your email inbox. You may need to wait a while for the email message to arrive.

Troubleshooting

If you experience any errors while authorizing or testing the connection, check the application link has been configured correctly. See Linking to another application

If this keeps happening, inspect atlassian-confluence.log for specific error details. See Working with Confluence logs to learn how to do this. For help diagnosing any issues, reach out to Support.

Last modified on Apr 1, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.