To configure Confluence to use Gmail to send emails, you will need to create a JNDI mail session and then have Confluence use it, as described below.
To do this for the Confluence distribution, please see Setting Up a Mail Session for the Confluence Distribution.
- Stop Confluence.
- Move (don't copy)
activation-1.0.2.jar
andmail-1.4.1.jar
from/confluence/WEB-INF/lib
to<Confluence Standalone install>/lib
. Or if you are using Confluence WAR release, move to<Tomcat 5 install>/common/lib
or<Tomcat 6 install>/lib
. Paste the following code in confluence.xml or server.xml located at <confluence-install>/conf, inside the
<Context>
node (substitute username and password):Tomcat 5.5 or Tomcat 6<Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="smtp.gmail.com" mail.smtp.port="465" mail.smtp.auth="true" mail.smtp.user="nobody@gmail.com" password="foobar" mail.smtp.starttls.enable="true" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />
- Restart your Confluence instance.
- Add
java:comp/env/mail/Session
to your JNDI mail configuration fromAdministration > Mail Servers
.
Note: You may optionally add mail.debug="true"
into the <Resource>
to see logs generated by JavaMail.