how to configure gmail smtp server configuration using admin console in confluence
Asked by Vikash Kumar:

Q. how to configure gmail smtp server configuration using admin console in confluence ??

There are two ways to configure smtp server as per the confluence Mail Servers page.

**1. Server Hostname**

I tried to configure this

Server Hostname _______________

I put [smtp.gmail.com](http://smtp.gmail.com) here but it takes smtp.gmail.com:25 by itself.

User Name ______________

[vikash25june@gmail.com](mailto:vikash25june@gmail.com)

Password _____________

\*\*\*\*\*\*\*\*\*\*

**It append :25 by itself in Server Hostname and after I test send email gives error shown below.**

An error has occurred with sending the test email:

com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. sy10sm33744792pac.15 - gsmtp

**And if I change smtp.gmail.com:25 to smtp.gmail.com:465**

it takes infinite time with no response.

**2. Server Hostname** {#toc-hId-1709261505}
--------------------------------------------

For this I followed this [link](https://confluence.atlassian.com/pages/viewpage.action?pageId=42795030 "Smtp Configuration Link") I do not find activation.jar (as it is not needed for the updated version of confluence) and I moved the email.jar to below path.

**/atlastutorial/confluencePluginDemo/target/container/tomcat6x/apache-tomcat-6.0.20/lib**

**Shutdown confluence** and tried changing the server.xml file at this location to add JNDI resource as per the link given below.

**/atlastutorial/confluencePluginDemo/target/container/tomcat6x/cargo-confluence-home/conf/server.xml**

\<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="vikash25june@gmail.com"

password="XXXXXXXX"

mail.smtp.starttls.enable="true"

mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"

/\>

and **atlas-run**

**This removes the above lines I have added to server.xml file/context.xml or server.xml file inside tomcat/conf after atlas-run and throw** **error "** **com.atlassian.mail.MailException: javax.naming.NameNotFoundException: Name mail is not bound in this Context** **".**

**I have**

1) installed atlassian sdk.

2) setup eclipse, maven and evertything needed for confluence plugin development.

3) created a simple plugin to add an web-item and tested that it appears by running ***atlas-run*** , Yes!! it appears.

at atlas-run, it downloaded many files for a long time and setup the confluence on my local inside my atlasttutorial folder. its here

/home/vikash/atlastutorial/confluencePluginDemo/

(list of directory inside the confluencePluginDemo is listed below)

LICENSE pom.xml README src target

Any help will be highly appriciated :).

Thanks,

vik


Answers:
author: Vikash Kumar
body: used my company's smtp service insted of gmail smtp and it works.

comments: author: anil kumar
body: Hi,

how can I give the mail configuration details with company's details/gmail's. for sending notifications.

Thanks

Anil


author: JohnA
body: Hi Vikas,

I don't believe it is possible to configure GMail as your SMTP server for Confluence solely through the administration console because there are some file level changes that need to be made to setup the JNDI mail session for Confluence but you can read about configuring GMail as an SMTP server for your Confluence instance in this document: <https://confluence.atlassian.com/pages/viewpage.action?pageId=42795030>

All the best,  
John

comments: author: Vikash Kumar
body: Thanks for your spontaneous reply @John :)

Yes, I have gone through the said link only and changed server.xml file under given path as well as under tomcat/conf but it gives error that the mail (JNDI resource) is not bound in this context.


Tags: confluence-app

confluence-development

email

smtp