Search code examples
jasper-reportsjasperserver

Email not sent in Jasper Report Scheduling


I want to schedule my jasper report so that at a particular time, it will send the report to the mentioned id. I'm using Jasper Server 4.5.0 and I have scheduled a sample report to be sent to my gmail id. However, it's not been sent to the mail id and it doesn't show any Last Ran time too.


Solution

  • I found it hard to setup GMail as my email server. So once I got it working I posted the details in this article.

    In the spirit of keeping StackOverflow answers self-contained, here are the key settings. js.quartz.properties:

    report.scheduler.web.deployment.uri=http://localhost/jasperserver
    report.scheduler.mail.sender.host=smtp.gmail.com
    [email protected]
    report.scheduler.mail.sender.password=mypassword
    [email protected]
    report.scheduler.mail.sender.protocol=smtp
    report.scheduler.mail.sender.port=587
    

    applicationContext-report-scheduling.xml:

    <property name="javaMailProperties">
        <props>
            <prop key="mail.smtp.auth">true</prop>  <!--as indicated in JasperReports-Server-Install-Guide.pdf)-->
            <prop key="mail.smtp.starttls.enable">true</prop>  <!--NOT indicated in JasperReports-Server-Install-Guide.pdf-->
        </props>
    </property>