Documentation for Confluence 5.4.
Documentation for Confluence OnDemand and earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata

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

You can personalise 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.

On this page:

Related pages:

Configuring Confluence to send email messages

To configure Confluence to send outgoing mail:

  1. Choose the cog icon  at top right of the screen, then choose Confluence Admin.
  2. Select Mail Servers under Configuration in the left-hand panel. This will list all currently configured SMTP servers.
  3. Click Add New SMTP Server (or edit an existing server).
  4. 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. You will not be able to complete the Confluence mail server configuration until this field has been specified.
    • 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 angled 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.
  5. Manually enter your Host Address, User Name and Password details (recommended)

OR

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.

Testing the email settings

A Confluence administrator can test the email server as follows:

  1. Set up a mail server at Confluence Admin > Mail Servers, 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 Confluence Admin > 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 Subscribing to Email Notifications of Updates to Confluence Content.
  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 Tools > Watch. See Watching 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.

53 Comments

  1. Mail sending does not work in standalone Confluence 2.6.0.  Tomcat 5.5.23 bundled with it is lacking org.apache.naming.factory.MailSessionFactory and a few other classes (see http://issues.apache.org/bugzilla/show_bug.cgi?id=40668).

     To fix it, owerwrite common/lib/naming-factory.jar with the version from Tomcat 5.5.25.

  2. Anonymous

    I also can confirm that you need to replace the bundled common/lib/naming-factory.jar with the version from Tomcat 5.5.25

    I am using Confluence 2.7 running the bundled Apache Tomcat/5.5.23  (Confluence installer downloaded on 10th Jan 2008).

    This was an upgrade so I *knew* I had correctly configured the server.xml and web.xml files, and I had moved the 3 files as described in the instructions (in fact, I think javamail-1.3.2.jar  was missing from WEB-INF/lib in the 2.7 bundle) - I copied it over from my Confluence 2.5.1 install directory.

    I downloaded the Tomcat 5.5 zip (link below) to extract common/lib/naming-factory.jar and replace the bundled one in confluence-2.7-std/common/lib/

    http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17.zip

  3. How do you change the time of day and email subject line for the daily update email?

    1. Hi Mark,

      Please ensure that you have a backup of every files that you are going to modify in the following steps.

      To change the time of day for the daily email report, please refer to a similar documentation at:

      The id of the bean, in this case should be dailyReportTrigger, instead of backupTrigger in the documentation.

      To change the email subject line to something else, please refer to the following page:

      The name of the parameter that you need to change is daily.report.title.

      Remember to restart your Confluence in order for the changes to take effect. Hope this helps.

      Cheers,
      Azwandi

  4. Anonymous

    How can we setup Confluence to send mail through an SMTP server that requires SSL for it's connection, such as Google Apps?

    Thanks,

    Sam

    1. You need to ensure your JRE CA certificate store has an entry that matches whoever provides your https:

      Try this example if it works you are done, if not, you will need to learn how to import the cert into your JRE/lib/security/cacerts file or create a truststore and setup your app server to override via -Djavax.net.ssl.trustStor , see http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Security6.html for details. Oh, and the JRE cacerts file pass is 'changeit' so you can base a new truststore on an existing one (that one should save you a day (smile)) see somepageorother for suggested ports settings specific to google.

      1. Anonymous

        Andy,

        Thank you for the examples and information, but we're interested in configuring Confluence, not writing a custom Java application to send mail.  Confluence mail setup  user interface provides fields for SMTP Host Name, Username, and Password.  There is no option on the page to tell Confluence to use SSL when connecting. 

        How do we get Confluence to use SSL?  In other places, such as retrieving mail, you can change the protocol (i.e, POPS instead of POP) but there is no such setting for outgoing mail.

        Thanks,

        Sam

        1. Anonymous

          Any luck with this so far?

          I am currently trying to setup Confluence to use our corporate Google Apps to send it's mail. This however requires a connection to an smtps (TLS) connection.
          Is this supported and if so how do I proceed?

          Thanks,

          Erwin

          1. Hi Sam & Erwin,
            Actually what Andy suggested was correct, despite he narrowed down the scope and focused on generating and importing the certificate (and some java code too (smile) ). To configure Confluence to send mail over SSL, you would need to use the a JNDI location for email instead of filling in the normal form, for example, in your server.xml, you can add the mail resource below:

            <Resource name="mail/GmailSmtpServer"
            auth="Container"
            type="javax.mail.Session"
            mail.smtp.host="smtp.gmail.com"
            mail.smtp.port="465"
            mail.smtp.auth="true"
            mail.smtp.user="myusername@gmail.com"
            password="mypassword"
            *mail.smtp.starttls.enable="true"*
            *mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"*
            />
            

            This is what we call as JNDI. Next import the SMTP server certificate into a Java keystore. The process is described on the Connecting to SSL Services page.

            Lastly, you would also need to tell Tomcat where the keystore file is located by adding the following to bin/setenv.bat or setenv.sh:

            export JAVA_OPTS="-Djavax.net.ssl.trustStore=$HOME/.keystore"

            If you still encounter problem connecting to SMTP over SSL after that, please feel free to log a support request at https://support.atlassian.com

            Hope it helps.

            Cheers,

    2. There's a Beta version of a Confluence SSL plugin  that facilitates this process.

  5. The javamail-x.x.x.jar is missing completely from our Confluence install directory.  (Confluence 2.9.1)

     If this .jar is required for the mail features to work properly:

    1)  Where can I download this?

    2)  Why is it not packaged with Confluence when installed?

    1. Hi Brian,

      From Confluence 2.6.1 version onwards, the javamail-x.x.x.jar is omitted. That means you are only required to move the activation-x.x.x.jar and mail-x.x.x.jar files from the confluence/WEB-INF/lib directory to the common/lib directory and restart your Confluence.

      Hope this helps. Thanks.

      Regards,
      MG

  6. Anonymous

    For 2.10.1, when defining a javamail session in server.xml, I have found that I need to put both the activation-x.x.x and mail-x.x.x jar in confluence-2.10.1-std/lib (top level) and only there, otherwise either

    1. tomcat won't find the right classes (if you only put them in either in WEB-INF/lib or in data/lib)

    or 2. the instance of session in Confluence and in Tomcat will end up being of differing classes (since the classes are from different classloaders) (if you copy them in the top-level lib and the data/lib directories)

  7. When configuring the mail server can the From field have the more descriptive email address such as "John Doe [j.doe@company.com]"

    Thanks

    1. Hi Steve,

      I am sorry that the From field does not accept special characters,however you can try using this way <John Doe>j.doe@company.com for more descriptive email address. Hope that helps.

      Cheers,
      Komathi

      1. Anonymous

        Hi Komathi,

        Is there a way to include the username while sending email notifications? If a user XYZ modifies a page,then can his username be shown in the email as XYZconfluence-admin@abc.com similar to JIRA notifications?

        Thanks

        1. Anonymous

          This would be terrific. At least give a 'reply-to' option.

      2. I think the correct format is John Doe<j.doe@company.com>

        1. Anonymous

          Hi

          Is it possible to make FROM field dynamic?. I want to put the confluence user email address who sends email.

          Thanks

          Karthik

  8. Just a few questions about the Mail API settings.

    Mail API type/version:  ??? Is it just Java?
    Does your API have a retry queue? Yes/No (I believe I read that it does...just wanted to confirm)
    Does your application use DNS for MX resolution? Yes/No
    Do you meet RFC Standards compliance? RFC2821/RFC2822?

    1. Hi,

      Mail API type/version

      Yes, it is Java. The latest version of Confluence uses mail-1.4.1.jar.

      Does your API have a retry queue?

      Yes, there is a queue. If the sending process fails, then the task to send an email message will be queued in the mail queue and you can push the message in the queue.

      Does your application use DNS for MX resolution?

      As far as I'm concerned, it wont look up the records for mail exchange.

      Do you meet RFC Standards compliance?

      Confluence is not a SMTP server, it is only a client like Thunderbird or Outlook.

  9. Anonymous

    If your mail server uses a secured socket simply add it's port number after the host name, as in: smtp.acme.com:587.

  10. In my case, moving the recommended files worked in 3.1.1.  I run Confluence in an embedded Tomcat with RHEL5:

    mv /opt/confluence-3.1.1/confluence/WEB-INF/lib/activation-1.0.2.jar /usr/share/tomcat5/common/lib/activation-1.0.2.jar
    mv /opt/confluence-3.1.1/confluence/WEB-INF/lib/mail-1.4.1.jar /usr/share/tomcat5/common/lib/mail-1.4.1.jar

    I had originally deployed in the same version of Tomcat under a standalone Tomcat installation and this was not a problem, however the paths are different between the standalone Tomcat and the Red Hat Tomcat.  The problem comes from the Red Hat concatenation of jars in my case:

    Standalone Tomcat:

    eluzcand 12626     1 16 11:52 pts/2    00:00:03 /home/eluzcand/jdk1.6.0_16/bin/java -Djava.util.logging.config.file=/home/eluzcand/apache-tomcat-5.5.28/conf/logging.properties -Xms2048m -Xmx2048m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/eluzcand/apache-tomcat-5.5.28/common/endorsed -classpath /home/eluzcand/apache-tomcat-5.5.28/bin/bootstrap.jar -Dcatalina.base=/home/eluzcand/apache-tomcat-5.5.28 -Dcatalina.home=/home/eluzcand/apache-tomcat-5.5.28 -Djava.io.tmpdir=/home/eluzcand/apache-tomcat-5.5.28/temp org.apache.catalina.startup.Bootstrap start

    Red Hat Tomcat:

    tomcat   10014     1  3 10:38 ?        00:02:37 /usr/lib/jvm/java/bin/java -Xms2048m -Xmx2048m -XX:MaxPermSize=256m -Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib -Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib -Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -classpath /usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar -Dcatalina.base=/usr/share/tomcat5 -Dcatalina.home=/usr/share/tomcat5 -Djava.io.tmpdir=/usr/share/tomcat5/temp org.apache.catalina.startup.Bootstrap start

  11. If you are just trying to use your Yahoo! mail account for outgoing mail from

    Confluence all I needed to do was use the following on the Edit SMTP Mail
    Server page:

    Name: SMTP Server

    From: insert your yahoo email address (joe@yahoo.com)

    Subject: [confluence] or whatever you want

    SMTP Host Address: plus.smtp.mail.yahoo.com:25

    User name: should match your Yahoo email address name (joe)

    Password: your Yahoo mail password

    Cheers,

  12. Anonymous

    smtp is fully working on the local server that has the tomcat + war distribution.

    When i use the admin console to send a test message (war only deployment to standard tomcat 5.5), I always get this:

    An error has occurred with sending the test email:
    com.atlassian.mail.MailException: javax.mail.NoSuchProviderException: smtp
        at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:191)

    The instructions for Standalone distribution:

    "Please move the above three jar files from the <Confluence-Install>/confluence/WEB-INF/lib directory to <confluence-install>/lib (for Confluence version 2.10 onwards) or <Confluence-Install>/common/lib (for earlier product versions) and restart Confluence."

    There are no instructions for war version, and I abhor hacking the global tomcat lib space for a particular webapp, as it may affect other webapps.

    However, to see if it worked, i moved activation-1.0.2.jar and mail-1.4.1.jar into the tomcat common/lib and restarted tomcat, but get the same error.

    If moving jars is an installation requirement for all versions, why is it not in the installation guide?

    1. Anonymous

      I mean copied the jars..

      1. Hercules found the answer - you have to delete activation and mail jars from confluence/WEB-INF/lib dir, restart tomcat and it works. (war only distribution).  Looks like this distro is not designed to work with tomcat 5.5.

  13. Configuring just From Name with ${fullname}

    causes mails to be sent like "Name Surname (admin@confluence.com)"

    This leads users to reply to the email hoping it will reach the user but actually this will go to the email configured with Confluence mail server.

    Even the From Address should be configurable or this issue should be resolved else keeping just from name configurable does not make sense.

    Bug report present here https://jira.atlassian.com/browse/CONF-22983

    Thanks and Regards

    Aditee

  14. I like the variable ${email} to be used for "From Name". I like it so much, I like to be able to use it for "From Address". This is to make sure that notification recipient can reply directly to the modifier of the page (rather than replying to some standard email address configured as "From Address").

    Cf. the following improvement: https://jira.atlassian.com/browse/CONF-23372

    1. Anonymous

      We also really would like to be able to do this. The one from Michael was Dupped.

      Please vote for it https://jira.atlassian.com/browse/CONF-10543

    2. What's needed actually is a Reply-To: field.

  15. Just in case...(wink)

    Has anyone tried to get confluence outgoing email working with Microsoft Online Services? I'm guessing it's similar to using Gmail. I know nothing about Java, etc., so this rather intimidating to me.

    1. To start, I found this page: Connect to the Microsoft Online Services SMTP Server. It requires TLS. Not sure what to do about that.

  16. Anonymous

    did you manage to get this working Tom?

    1. Anonymous

      I got lucky and didn't have to go this route. We ended up installing the SMTP service on another Windows server and set the SMTP service to relay to our MS Online stuff (not sure how exactly, our network person did it). Then we set Confluence to go through that internal SMTP server. Since we controlled the internal SMTP server we made it so it didn't need fancy authentication. The SMTP server (I believe) does have options for that so it could go to MS Online. Kind of hacky and it seems silly to need another server/service to do it, but it does work.

      1. Sorry, I didn't login before I posted that. (wink)

  17. Anonymous

    hi all

    i got the problem that received mail, which some send me from confluence try share a page with me, be displayed on mobile devices only after long loading. this happens by reason of css-file. this is reference to our intern domain an so the device cant (unless it's connected to VPN) access it.

    is it possible to embed the css-file into html? or is it possible to make only css file accessible from outside??

    an alternative would be to give up HTML and change to text messages.

    thanks for all answers!

     

     

     

  18. Is there anyway to set the From Address to use the logged in user?

    For instance, user A is watching a page.

    User B makes a change, so User A gets notified. However while the From User states it as User B, the actual email address used was the default one set in STMP setup, hence reply to this goes to the IT department.

    Can I just use ${email} in From Address too?

    1. John Rehill,

      Did you figure this out? I think I'm in the same boat as you and would like to stop explaining to the users to use forward instead of reply...

  19. Anonymous

    any one help how to configure email for jira. complete steps pls 

     

    muzammil.hussain@mfb.com.pk

    1. Hallo there

      Here is the JIRA documentation on setting up an email server: Configuring JIRA's SMTP Mail Server to Send Notifications

      Cheers, Sarah

  20. In option 5. Manually enter your Host Address, User Name and Password details (recommended)

     

    We are seeing that it wont accept a blank username and password option here and will put in the current admin user's details. Is there a way to make it use just an IP? Our smtp servers are set up to relay only based on IP currently.

  21. Anonymous

    hello, I get an error while trying to send a test mail because I have no username and password.
    It is right for me because the exchange 2010 server internalrealy allow confluence IP to relay without any authentication.

    But confluence won't understand and it needs a user name and password.

     

    How can I work-around over it? 

  22. Hi there. I think you might be hitting this bug:  CONF-29000 - If mail.smtp.auth is ever set to true in a mail server config, it is never set to false again when usernames and passwords are removed. Open

    If a username and password are ever saved in those fields, it sets a value to true which then requires authentication, however when the username and password are cleared, it still requires auth. You can workaround it by deleting the mail server config and starting again, making sure that no username and password are ever saved. 

    If that doesn't fix it, you can create a ticket at https://support.atlassian.com and the Support team will help you out.

  23. when I used confluence 5.1.x, I moved activation-1.0.2.jar and mail-1.4.5.jar into CONFLUENCEPATH/lib. and added resource info into server.xml.

    But I upgraded 5.1.x into the lastest 5.2, there isn't activation-1.0.2.jar in confluence/WEB-INF/lib. Where could I find it?

  24. Confluence allows for multiple Mail Servers to be defined, but there isn't a way to sort them or define a default server.  How does Confluence decide which one to use?  If you have more than one mail server defined, what determines which is used & when?  Does Confluence just try them all in alphabetical or date-defined order until one works?  

  25. In confluence 5.3 the activation-x.x.x.jar does not exist? Clearly these instructions are slightly out of date given the mail jar is version 1.4.5 in the latest release... Can you confirm if the above is still applicable in the latest version?

    1. The Java Activation Framework is now included with the JDK and does not need to be bundled in Confluence. I'll update the documentation to remove the reference.

  26. in Confluence 5.4.3, when trying to send test email, I'm getting this error message:

    An error has occurred with sending the test email. If your mail server requires authentication, please ensure that TLS or SSL is enabled on your server for the specific maibox  (etc)

    com.atlassian.mail.MailExeption: javax.mail.AuthenticationFailedException: No authentication Mechanisms supported by both server and client

    (etc)

    I have a test instance of Confluence 4.3.7 on the same server and the same configuration (as far as of this configuration screen). No such problem there.

  27. does Confluence 5.x provide the ability to respond to a notification, which should result in creation of a comment ?

     

  28. Hi,

     

    Any way to turn this off completely so no emails are sent in ondemand? or to limit it per page. Say for example you have a page with sensitive info and when you make a change it is transmitted insecurely over emails? We are using ondemand.

     

    Thanks,

    Sunny

    1. Hi Sunny,  you would need system administrator to make changes to the mail and notifications settings. Contact support , they may be able to disable notifications in your instance.