Jump to content
We've recently updated our Privacy Statement, available here ×

Unable to Scheduled Report - smtp.office365.com


diegolimahif

Recommended Posts

I'm having a hard time configuring Jasper to send some reports by email.

I did a lot of research and tests with some of the questions from some colleagues here, but unfortunately I still haven't been able to solve the problem.

I made the file settings as in the example below and I still keep getting an error message.

js.quartz.base.properties:

report.scheduler.mail.sender.host=smtp.office365.com
report.scheduler.mail.sender.username=mailaddress
report.scheduler.mail.sender.password=mailpass
report.scheduler.mail.sender.from=mailaddress
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=587
report.scheduler.mail.smtp.starttls.enable=true
report.scheduler.mail.smtp.auth=true

 

Add the <prop key="mail.smtps.starttls.enable">true</prop>  on pplicationContext.xml and applicationContext-report-scheduling.xml files.

 

The error message warned that STARTTLS is required to send mail, as bellow:

ERROR ReportExecutionJob, quartzScheduler_Worker-2: 354 - fail to send out alert mail notificationorg.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [CP5P284CA0075.BRAP284.PROD.OUTLOOK.COM]
; message exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 451 5.7.3 STARTTLS is required to send mail [CP5P284CA0075.BRAP284.PROD.OUTLOOK.COM]

 

When i changed the smtp options in the js.quartz.base.properties, applicationContext.xml and applicationContext-report-scheduling.xml files to smtps the error changed to:

 

Failed message 1:

javax.mail.MessagingException: Exception reading response;

  nested exception is:

                javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

                at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)

                at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)

                at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

                at javax.mail.Service.connect(Service.java:275)

                at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)

                at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)

                at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)

                at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJobAlertImpl.sendAlertMail(ReportExecutionJobAlertImpl.java:97)

                at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendAlertMail(ReportExecutionJob.java:767)

                at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:594)

                at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:243)

                at com.jaspersoft.ji.report.options.engine.ReportOptionsExecutionJob.execute(ReportOptionsExecutionJob.java:47)

                at org.quartz.core.JobRunShell.run(JobRunShell.java:213)

                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)

Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

                at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)

                at sun.security.ssl.InputRecord.read(Unknown Source)

                at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)

                at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)

                at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)

                at sun.security.ssl.AppInputStream.read(Unknown Source)

                at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)

                at java.io.BufferedInputStream.fill(Unknown Source)

                at java.io.BufferedInputStream.read(Unknown Source)

                at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)

                at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)

                ... 13 more

Is there any other configuration I need to do to correct this error?

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...