jasperreports: email configuration (gmail)

1.1. Edit js.quartz.properties

sudo vim /opt/jasperreports-server-cp-5.1.0/apache-tomcat/webapps/jasperserver/WEB-INF/js.quartz.properties

report.scheduler.mail.sender.host=smtp.gmail.com
report.scheduler.mail.sender.username=username@gmail.com
report.scheduler.mail.sender.password=s3cr3t
report.scheduler.mail.sender.from=username@gmail.com
report.scheduler.mail.sender.protocol=smtps
report.scheduler.mail.sender.port=465

1.2. Edit "applicationContext-report-scheduling.xml"

 

sudo vim /opt/jasperreports-server-cp-5.1.0/apache-tomcat/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml

 

Add the following Lines to the Code.

<prop key="mail.smtps.auth">true</prop>
<prop key="mail.smtps.starttls.enable">true</prop>

As seen below:

 

<bean id="reportSchedulerMailSender">
<property name="host" value="${report.scheduler.mail.sender.host}"/>
<property name="username" value="${report.scheduler.mail.sender.username}"/>
<property name="password" value="${report.scheduler.mail.sender.password}"/>
<property name="protocol" value="${report.scheduler.mail.sender.protocol}"/>
<property name="port" value="${report.scheduler.mail.sender.port}"/>
<property name="javaMailProperties">
<props>
                <prop key="mail.smtps.auth">true</prop>
<prop key="mail.smtps.starttls.enable">true</prop>
            </props>
</property>
</bean>

 

Reference: http://community.jaspersoft.com/questions/540414/config-jsquartzproperties-use-gmail

Leave a Reply

Your email address will not be published. Required fields are marked *