How to configure JasperReports Server to send e-mails via Gmail mail account

In this short article I want to share with you my experiense that I've got when I tried to configure TIBCO JasperReports® Server to sent it's e-mails with reports via https Gmail e-mail account.

To do this we should edit 2 configuration files:

in the jasperserver-pro\WEB-INF\js.quartz.properties file

report.scheduler.mail.sender.protocol should be set to smtps

report.scheduler.mail.sender.protocol=smtps

report.scheduler.mail.sender.port should be set to 465

report.scheduler.mail.sender.port=465

Below is shown the screenshot from my own configuration (please use your e-mail address and password of gmail account instead of information that is provided on the screenshot)

in the jasperserver-pro\WEB-INF\applicationContext-report-scheduling.xml file

Configure the javaMail property as shown:

<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>

The application server needs be restarted to apply the changes that have been done.

You will also need to set Allow less secure apps: ON for your Gmail acccount

Alex

Comments

I do everyting but dont send email.

js.quartz.properties

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

report.scheduler.mail.sender.host=smpt.gmail.com
report.scheduler.mail.sender.username=luXXXXXda@gmail.com.sv
report.scheduler.mail.sender.password=$XXXXX$
report.scheduler.mail.sender.from=luXXXXXda@gmail.com.sv
report.scheduler.mail.sender.protocol=smtps
report.scheduler.mail.sender.port=465

applicationContext-report-scheduling.xml

   <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>
                 <prop key="mail.smtps.starttls.enable">true</prop>
                 
            </props>
        </property>
    </bean>

can you help me please!!

I am using JasperServer cp 7.1.1

Feedback