Setup SMTP in Jaspersoft for scheduled reports
search cancel

Setup SMTP in Jaspersoft for scheduled reports

book

Article ID: 93228

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

We are trying to set up js.quartz.properties to define SMTP server in order to email scheduled reports. Our SMTP server does not require credentials - if I comment out the section for credentials, Jasper Tomcat does not start (errors out) How can I set up SMTP server in this file w/o using credentials?

Environment

Release: All Supported Releases
Component: SPCJSP - Jaspersoft for Spectrum

Cause

The SMTP server needs to be configure for Jaspersoft to email scheduled reports. 

Resolution

To set the SMTP host information for Jaspersoft, update the 'report.scheduler.web.deployment.uri' attribute value in the 'js.quartz.properties' file, which is located at <jasperserver-pro>/WEB-INF/js.quartz.properties.

report.scheduler.web.deployment.uri=http://localhost:8080/jasperserver-pro

report.scheduler.mail.sender.host=mail.example.com
report.scheduler.mail.sender.username=admin
report.scheduler.mail.sender.password=password
[email protected]
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=25

- Be sure to edit the report.scheduler.web.deployment.uri and change "localhost:8080" to be the actual Jaspersoft hostname
- If the SMTP server does not require login credentials, these lines can be left blank. E.G.:
report.scheduler.mail.sender.username=
report.scheduler.mail.sender.password=

These lines cannot be commented out, they must be left blank

 

In addition, if the SMTP server connection is over a secure connection "SMTPS" then you may also need to enable SMTPS in jasperserver-pro\WEB-INF\applicationContext-report-scheduling.xml file:

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


<bean id="reportSchedulerMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<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>
</props>
</property>
</bean>


- Restart Jasersoft Tomcat for changes to take effect.

Additional Information

Please reference the "How to run Reports Using JasperReports Server" section of the Spectrum documentation for more information.


Please reference the "Setting Up the Connection to your Outbound Email Server" for more information