config js.quartz.properties to use gmail

0

Could someone please give me a config js.quartz.properties that can use gmail to send email?

I tried the following config but it doesn't work.

report.scheduler.mail.sender.host=smtp.gmail.com
report.scheduler.mail.sender.username=myuser
report.scheduler.mail.sender.password=mypass
report.scheduler.mail.sender.from=myuser@gmail.com
report.scheduler.mail.sender.protocol=smtps
report.scheduler.mail.sender.port=465
report.scheduler.mail.smtps.auth=true
report.scheduler.mail.smtps.starttls.auth=true

I got the following error message.

Job: Background Execution (ID: 9) Report unit: /reports/samples/AllAccounts Quartz Job: ReportJobs.job_9 Quartz Trigger: ReportJobs.trigger_9_0 Exceptions: The job error notification was not completed. An error occurred while sending it. org.springframework.mail.MailSendException; nested exception details (1) are: Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 f24sm38187699yhk.5 at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583) at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:403) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:342) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:1262) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:444) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:230) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)



Post Edited by vaxim at 09/28/2011 15:18
vaxim's picture
65
Joined: May 29 2009 - 3:22pm
Last seen: 11 years 2 months ago

2 Answers:

3

I can make it work.

 

C:\\Program Files\\jasperreports-server-4.1\\apache-tomcat\\webapps\\jasperserver-pro\\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

 

C:\\Program Files\\jasperreports-server-4.1\\apache-tomcat\\webapps\\jasperserver-pro\\WEB-INF\\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>

vaxim's picture
65
Joined: May 29 2009 - 3:22pm
Last seen: 11 years 2 months ago

Thank you for this, still works as of JRS 5.5.

Jay

jay_2 - 6 years 4 months ago

very helpful. That saved me a bunch of time. thanks.

colin.rooney - 6 years 1 month ago

Searched a ton, but this fixed it!

max_max_mir - 5 years 10 months ago
show 1 more...

Thank you!! still works as of JRS 5.6

ludini - 5 years 4 months ago
0
kkumlien's picture
3808
Joined: Jan 22 2015 - 4:36am
Last seen: 3 weeks 1 day ago
Feedback
randomness