4

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.

Sahar Hassan
  • 301
  • 3
  • 7
  • 23
  • Did you set properties in `js.quartz.properties` file? See also [this question](http://stackoverflow.com/questions/9630528/how-to-configure-mail-server-settings-in-jasper-server-4-0-0) – Alex K Mar 13 '12 at 12:37
  • I had set the host as report.scheduler.mail.sender.host=smtp.gmail.com. Is this right for gmail server? – Sahar Hassan Mar 13 '12 at 12:53
  • http://support.google.com/mail/bin/answer.py?hl=en&answer=13287 – Alex K Mar 13 '12 at 12:55
  • Nothing seems to be working. No email is been generated so far. There is one more parameter in the file which I have like: report.scheduler.web.deployment.uri=http://localhost:8080/jasperserver. I have given uri of the starting page of my local jasper server. Is this right? – Sahar Hassan Mar 13 '12 at 14:06
  • I think this is the right value – Alex K Mar 13 '12 at 20:10
  • Did you check the log files? Did you check the `//WEB-INF/applicationContext-report-scheduling.xml` file? – Alex K Mar 13 '12 at 20:11
  • I have checked the log. It's only Warnings there. No error messages. And in the xml file u said I have the following entry: – Sahar Hassan Mar 14 '12 at 05:24
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/8849/discussion-between-sahar-hassan-and-alex-k) – Sahar Hassan Mar 14 '12 at 05:24

3 Answers3

12

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
report.scheduler.mail.sender.username=me@gmail.com
report.scheduler.mail.sender.password=mypassword
report.scheduler.mail.sender.from=me@gmail.com
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>
mdahlman
  • 9,204
  • 4
  • 44
  • 72
1

One observation,

If you´re going to use an email from Microsoft Exchange, you need on more line in the applicationContext-report-scheduling.xml

        <props>
            <prop key="mail.smtp.auth">true</prop>
            <prop key="mail.smtp.starttls.enable">true</prop>
            <prop key="mail.smtp.starttls.required">true</prop>
        </props>
0

in my case works with this

first edit this arquive

/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=your_password
report.scheduler.mail.sender.from=username@gmail.com
report.scheduler.mail.sender.protocol=smtps
report.scheduler.mail.sender.port=465

second edit this

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

<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>
henriquesuda
  • 189
  • 1
  • 3