Confluence Latest : Setting Up a Mail Session for the Confluence Distribution

Set up a mail session for the Confluence distribution to use Gmail as follows:

  1. Stop Confluence.
  2. Move (don't copy) activation-1.0.2.jar and mail-1.4.1.jar from <confluence-install>/confluence/WEB-INF/lib to <confluence-install>/lib.

    Icon

    The version numbers on these jar files may vary, but that should not matter. As of Confluence 5.2.3, activation-1.0.2.jar no longer exists, and does not need to be moved or downloaded

  3. Add the following to your server.xml file found in <confluence-install>/conf/ (add it just before the </Context> tag):

    For Confluence 3.5.x
    <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="yourEmailAddress@gmail.com"
        password="yourPassword"
        mail.smtp.starttls.enable="true"
        mail.transport.protocol="smtps"
        mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
    />
    
  4. Restart Confluence.
  5. Choose the cog icon  at top right of the screen, then choose Confluence Admin.

  6. Choose Mail Servers.
  7. Choose either Edit an existing configuration, or Add a new SMTP mail server.
  8. Edit the server settings as necessary, and set the JNDI Location as:

         java:comp/env/mail/GmailSMTPServer
    


    Note that the JNDI Location is case sensitive and must match the resource name specified in server.xml.

  9. Submit, and send a test email.