JasperServer: Could not connect to SMTP host error

I am trying to send scheduled reports as email attachments from JasperServer 5.6. Here's what I have configured

/home/ubuntu/JasperServer/apache-tomcat/webapps/jasperserver/WEB-INF/js.quartz.properties

# This file is now just a pass-through for stuff in the
# file referenced by the Maven js.quartz.properties file.
 
quartz.delegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
 
quartz.tablePrefix=QRTZ_
 
quartz.extraSettings=
 
report.scheduler.mail.sender.host=smtp.google.com
report.scheduler.mail.sender.username=xxx@gmail.com
report.scheduler.mail.sender.password=xxx
report.scheduler.mail.sender.from=xxx@gmail.com
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=587
 
report.scheduler.web.deployment.uri=http://ubuntu.xxx.com:8080/jasperserver

/home/ubuntu/JasperServer/apache-tomcat/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml

<property name="javaMailProperties">
    <props>
        <prop key="mail.smtp.auth">true</prop>
        <prop key="mail.smtp.starttls.enable">true</prop>
    </props>
</property>

But I get the following error

Could not connect to SMTP host: smtp.google.com, port: 587

My JasperServer is on a VirtualBox VM which can access the internet. I cannot telnet smtp.google.com on port 587 either on the VM or the Host Machine (and I am able to connect to the internet on both). Any hints as to what I may be doing wrong?

max_max_mir's picture
Joined: Jul 21 2010 - 9:03am
Last seen: 4 years 4 months ago

Changes I had to make to get this working

report.scheduler.mail.sender.host=smtp.gmail.com

report.scheduler.mail.sender.protocol=smtps

report.scheduler.mail.sender.port=465

<prop key="mail.smtps.auth">true</prop>

<prop key="mail.smtps.starttls.enable">true</prop>

max_max_mir - 9 years 1 week ago

3 Answers:

I had to make multiple changes (highlighted below) /home/ubuntu/JasperServer/apache-tomcat/webapps/jasperserver/WEB-INF/js.quartz.properties report.scheduler.mail.sender.host=smtp.gmail.com report.scheduler.mail.sender.protocol=smtps report.scheduler.mail.sender.port=465 /home/ubuntu/JasperServer/apache-tomcat/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml true true
max_max_mir's picture
Joined: Jul 21 2010 - 9:03am
Last seen: 4 years 4 months ago

Try:

report.scheduler.mail.sender.protocol=smtps
report.scheduler.mail.sender.port=465

tchen's picture
123033
Joined: Feb 27 2008 - 7:33am
Last seen: 3 hours 33 min ago

Now I get this

The job error notification was not completed. An error occurred while sending it.
org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257

My credentials are okay and I followed the steps in the link. Oh - and I had to change smtp.google.com to smtp.gmail.com

max_max_mir - 9 years 1 week ago
max_max_mir's picture
Joined: Jul 21 2010 - 9:03am
Last seen: 4 years 4 months ago
Feedback