Documentation for Confluence 4.1.x. Documentation for earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata

Configuring your Confluence server to send outgoing mail 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.

(info) You need to have System Administrator permissions in order to perform this function.

(warning) The information on this page does not apply to Confluence OnDemand.

Configuring Confluence to Send Outgoing Mail

To configure Confluence to send outgoing mail:

  1. Go to the Confluence 'Administration Console':

    • Choose Browse > Confluence Admin. The 'Administrator Access' login screen will be displayed.
    • Enter your password and click Confirm. You will be temporarily logged into a secure session to access the 'Administration Console'.
  2. Select 'Mail Servers' under 'Configuration' in the left 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.
      (info) 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).
      (tick)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.

      (info) 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 a subject prefix, if required.
  5. Configuring the Host Address, User Name and Password:
    • Manually enter your 'Host Address', 'User Name' and 'Password' details in the form fields displayed (recommended).
      OR
    • Specify the 'JNDI location' of a mail session configured in your application server in the form field displayed.

Troubleshooting

If you experience problems with these configurations, please check that your <Confluence-Install>/confluence/WEB-INF/lib contains only one copy of the following JAR files:

  1. activation-x.x.x.jar
  2. mail-x.x.x.jar

Ideally, these should be:

  • activation-1.0.2.jar
  • mail-1.3.2.jar (or later)

You will then need to move these into the proper directory:

Confluence distribution: Please move (not copy) the two 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.

Related Topics

Page: The Mail Queue
Page: How do I configure Confluence to use GMail as the mail server
Page: Configuring a Confluence Email Server for Email Notifications
Page: Setting Up a Mail Session for the Confluence Distribution
Page: Configuring a Server for Outgoing Mail

  1. Oct 08, 2007

    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. Jan 16, 2008

    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

    1. Oct 21, 2008

      Anonymous

      I get a "Connection Refused: Connect" message in version 2.9.1

      However, I have also upgraded (from 2.6.1 where it was working) so have kept the data folder as is.

      I've done everything in the documentation and what you suggest but keep getting the message.

      1. Oct 22, 2008

        Hi,

        I would suggest you to raise a support ticket at http://support.atlassian.com, advice the steps that you have taken and attach the full error message to the ticket.

        Cheers,
        Azwandi

  3. Jul 27, 2008

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

    1. Jul 28, 2008

      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. Aug 14, 2008

    Anonymous

    Hi

    We are using WIKI space . We want to send  email through WIKI page to our group when we upload any doc on that wiki page.

    Regards,

    Varinder Singh

    Senior Engineer 

    1. Aug 14, 2008

      Hi Varinder,

      You may want get your users to Watch the page/Space to receive notification on content changes. Please see the following link for more options on tracking updates:

      Regards,
      MG

  5. Sep 11, 2008

    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. Sep 11, 2008

      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. Sep 11, 2008

        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. Nov 06, 2009

          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. Nov 12, 2009

            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,

  6. Oct 01, 2008

    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. Oct 14, 2008

      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

  7. Jan 17, 2009

    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)

  8. Jan 29, 2009

    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. Feb 11, 2009

      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. Sep 01, 2009

        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

      2. Dec 08, 2009

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

        1. Jun 26, 2010

          Anonymous

          Hi

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

          Thanks

          Karthik

            1. May 09, 2011

              I am also trying to fill the from field with the email adress of the user who changed content. How can I use the mail-form plugin help me with this?

              Thank you

              Heiko

              1. May 09, 2011

                please check all my comments from the above link, it is being explained there

  9. Feb 13, 2009

    Anonymous

    We have configured a JNDI location. This JNDI works perfectly. I declare the hostname in the JNDI and the from in Confluence administration.

    However, how can i be sure that someone cannot usurp an identity when sending a mail from within a formular in a page or something like.

    Is it possible to create a page an add a sendto() function to send mail to the whole company?

    Our securit team ask me to be sure about this, because they dont want someone to send a mail to the whole Company and changing the from...

    Thnaks for your help,

    Sincerly,

    Michael

  10. Mar 11, 2009

    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. Apr 01, 2009

      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.

  11. Aug 06, 2009

    Anonymous

    Our configuration is currently set (for security purposes) to only email internal users @mydomain.com.

    We have built several unique business process forms that allow us to interact with external partners (each with slightly different requirements).  

    How do I create a whitelist that ONLY allows internalusers@mydomain.com and a set of specifically allowed (26 whitelisted) external email addresses.  I don't want to open up my system to allow all external addresses as it feels like a huge security hole.

    IDEAS?

  12. Dec 13, 2009

    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.

  13. Mar 24, 2010

    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

  14. Apr 17, 2010

    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,

    1. May 09, 2011

      Anonymous

      Hello,

      Todd Katz.

      Did you success.

      I configure 163 mail ,unsuccessfully.

      1. May 10, 2011

        some servers, especially in large companies, do not have a direct access outside their network to specific ports

        1. May 11, 2011

          Thank you very much.

          I have configured it successfully. Just need to enable the smtp service.

          But ,when I configure the mail server in linux, I can not make it.

          part of the log information:

          Did you go through this experience.

          Is there differece between windows and linux related to the mail configuration.

          Sorry, I am a Chinese. And my english is poor. I hope that you can understand what I say.

          Allison

  15. Apr 22, 2010

    This is so damned complicated I can't believe it. I've never seen any app require this much hoop jumping to set up SMTP servers (secure like Gmail, etc.)

    Please use the TaskDock method, where you can input the information directly in the admin console and you are done.

  16. Jun 16, 2010

    Anonymous

    How do I reset the original Email Server information? I accidentally messed around with the Email information and now no outgoing emails will send.

    1. Aug 04, 2010

      Hi

      I am afraid that this is not currently possible. Feel free to raise a feature request at http://jira.atlassian.com and describe in detail how you require this feature to work. Please add yourself as a watcher, vote for this feature and add your own comments to this feature request. For further details on how we include new features and improvements, you might want to read this page

      Hope that helps.

      Cheers
      JSashi

  17. Jun 24, 2010

    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. Jun 24, 2010

      Anonymous

      I mean copied the jars..

      1. Jun 24, 2010

        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.

  18. Nov 04, 2010

    Anonymous

    While trying to configure this for an SSL-enabled mail server (smtps) I seriously considered changing my career as a software architect to being a test subject for the ASS (American Sadomasochistic Society) or the IRS - it can't possibly be more painful in any way.

    So, if you want to use an SSL-enabled mail server (which everbody do nowadays) in JIRA and the Gmail mail server in particular, you will find all the steps in this article, Thanks Jeremy and Jason.

  19. Apr 19, 2011

    Subject Prefix: Enter a subject prefix, if required.

    – are you kidding me? Confluence requires me to enter a prefix. (sad)

    Is there a workaround?

    -Stefan

    1. Apr 19, 2011

      Hi Stefan

      Thanks for your comment. I agree with you!
      I've found this existing JIRA issue: http://jira.atlassian.com/browse/CONF-10148.
      I've added your comment, but you could add yourself as a watcher, vote for this feature and add your own comments.

      regards
      Paul

      1. Apr 20, 2011

        Yeah, I've seen that (and voted. too). I was more "complaining" about the description above, as it sort of indicates that it is my decision whether I enter the prefix - but it is not.

        Anyway, thanks for the response and don't worry. It's just a minor thing. (wink)

        -Stefan

  20. Apr 19, 2011

    Anonymous

    I was also getting the authentication error. Turns out that "localhost" all of a sudden became required on host, whereas the the smtp server name had been working previously. Moving the jar files did not help at all, by the way, and it seems very unlikely that this is necessary which is probably why it is delivered the way it is. I have asked my host why did I need localhost all of a sudden but have not yet received an answer. Just wanted to get this out.

  21. May 11, 2011

    I am trying to congfigure a server for outgoing mail, using yang.caixia@bestv.com.cn.

    But unsuccessfully.

    The mail system of the company that I work for is Exchange Server.

    the configuration information:

    When I send test email, there are errors.
    part of the log information:

    What should I do?

    By the way, after the success, Can all users receive notifications and daily reports of updates? and how to do it? 

    Thank you very much.

    regards

    Allison

  22. May 11, 2011

    I have configure the mail server in windows 7 system,successfully. But, I can not make it in linux. 

    part of the log information:

    Is there differece between windows and linux related to the mail configuration.

    Sorry, my english is poor.

    Thank you very much.

    Allison

  23. Jul 29, 2011

    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

  24. Sep 30, 2011

    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. Jan 04, 2012

      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

  25. Jan 13, 2012

    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. Jan 13, 2012

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