What are the setting values in order to use Gmail

In version 1.0.1 I was able to use the scheduler after the changes in the artifact: http://www.jasperforge.org/sf/go/artf1170;jsessionid=4B8B5B93F34AE5756F543B7C2CB4DDF8?nav=1
. With the new settings prompted during installation I just can't make it work.

Any help is greatly appreciated. This feature is a huge component of the production final tests I'm doing.

Thanks in advance.
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago

19 Answers:

The settings in this area have not changed in the new release.

Have a look at /WEB-INF/js.mail.properties. You can see the port setting.


Sherman
JasperSoft
swood's picture
24621
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
The installer prompst for new information and I think that's the issue. It asks for a protocol entry. I've used many options with no luck (SSL, STARTTLS, etc). Also Í specify the port that worked on the previous version 587. Just in case the hostname is smtp.gmail.com.

Any idea?
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago
The relevant configuration is in ?WEB-INF/applicationContext-report-scheduling:


Code:
	<bean id="reportSchedulerMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"><br />
		<property name="host" value="${report.scheduler.mail.sender.host}"/><br />
		<property name="username" value="${report.scheduler.mail.sender.username}"/><br />
		<property name="password" value="${report.scheduler.mail.sender.password}"/><br />
		<property name="protocol" value="${report.scheduler.mail.sender.protocol}"/><br />
		<property name="port" value="${report.scheduler.mail.sender.port}"/><br />
	</bean><br />
</td></tr></tbody></table><br />
<br />
From http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/mail/javamail/JavaMailSenderImpl.html#setProtocol(java.lang.String)<br />
<br />
Protocol is a mail protocol, like 'SMTP'.<br />
<br />
Sherman<br />
JasperSoft
swood's picture
24621
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
Thanks for the feedback. Just want to point out that it doesn't matter what you write down in the installer for the port it always writes 25 to the js.mail.properties file.

Fixed that directly on the file and restarted the server. I got the following error with port 587:

Code:
<br />
11:07:43,944 ERROR ReportExecutionJob,JasperServerScheduler_Worker-0:179 - org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.NoSuchProviderException: No provider for SMTP<br />
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.NoSuchProviderException: No provider for SMTP<br />
javax.mail.NoSuchProviderException: No provider for SMTP<br />
	at javax.mail.Session.getProvider(Session.java:455)<br />
	at javax.mail.Session.getTransport(Session.java:650)<br />
	at javax.mail.Session.getTransport(Session.java:631)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.getTransport(JavaMailSenderImpl.java:412)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:372)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:326)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:322)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:483)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendToDestinations(ReportExecutionJob.java:294)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:131)<br />
	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)<br />
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)<br />
</td></tr></tbody></table><br />
<br />
Changed the port to 465 and restarted the server. I'm still waiting for the email but at least I got no error in the log.<br />
<br />
I'll let you guys know if the email arrives. I guess it should now.
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago
Got an error also... Looks to be another thing...


11:41:39,251 ERROR ReportExecutionJob,JasperServerScheduler_Worker-1:179 - org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.NoSuchProviderException: No provider for SMTP
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.NoSuchProviderException: No provider for SMTP
javax.mail.NoSuchProviderException: No provider for SMTP
at javax.mail.Session.getProvider(Session.java:455)
at javax.mail.Session.getTransport(Session.java:650)
at javax.mail.Session.getTransport(Session.java:631)
at org.springframework.mail.javamail.JavaMailSenderImpl.getTransport(JavaMailSenderImpl.java:412)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:372)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:326)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:322)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:483)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendToDestinations(ReportExecutionJob.java:294)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:131)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

Post edited by: javydreamercsw, at: 2006/10/31 14:43
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago
Hi All, the installer has an "informational bug" regarding the js.mail.properties setting. The protocol setting needs to be "smtp" (note the non-capitalization).

This is also the only protocol that is currently supported (so the installer bug is that "smtp" should be the default).
tkavanagh's picture
16562
Joined: Jul 7 2006 - 8:54am
Last seen: 9 years 3 weeks ago
try 'smtp' (lower case)


Sherman
JasperSoft
swood's picture
24621
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
Looks like we are getting closer. Now I do get a response from the smtp server (after setting protocol to 'smtp') but sadly is an error:

Code:
<br />
07:55:05,952 ERROR ReportExecutionJob,JasperServerScheduler_Worker-1:179 - org.springframework.mail.MailSendException: Could not send mails: 530 5.7.0 Must issue a STARTTLS command first 5sm1693961nzk<br />
<br />
org.springframework.mail.MailSendException: Could not send mails: 530 5.7.0 Must issue a STARTTLS command first 5sm1693961nzk<br />
<br />
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first 5sm1693961nzk<br />
<br />
	at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)<br />
	at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)<br />
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:382)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:326)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:322)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:483)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendToDestinations(ReportExecutionJob.java:294)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:131)<br />
	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)<br />
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)</td></tr></tbody></table><br />
<br />
Thanks in advance!
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago
Add
Code:
<br />
<property name="javaMailProperties"><br />
	<props><br />
		<prop key="mail.smtp.auth">true</prop><br />
		<prop key="mail.smtp.starttls.enable">true</prop><br />
	</props><br />
</property><br />
</td></tr></tbody></table><br />
<br />
to the "reportSchedulerMailSender" bean in applicationContext-report-scheduling.xml.<br />
<br />
Setting mail.smtp.auth seems a little redundant, since ideally it should be implied by a non-empty username.  We'll have to think whether we can do something about this..<br />
<br />
Regards,<br />
Lucian
lucianc's picture
87103
Joined: Jul 17 2006 - 1:10am
Last seen: 2 hours 10 min ago
Finally worked! Just as a note, it only works on port 587 on Gmail, 465 gives errors.

This had to be done also on the previous version, now that I recall, but I spected it to be included in this version...
Post edited by: javydreamercsw, at: 2006/11/01 15:11
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago
I have sending email problem too.
it always gave me the error says:
Code:
Job: test (ID: 11)<br />
Report unit: /reports/samples/SalesByMonth<br />
Quartz Job: ReportJobs.job_11<br />
Quartz Trigger: ReportJobs.trigger_11_0<br />
Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;<br />
  nested exception is:<br />
	java.net.ConnectException: Connection refused: connect<br />
org.springframework.mail.MailSendException; nested exceptions (0) are:<br />
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;<br />
  nested exception is:<br />
	java.net.ConnectException: Connection refused: connect<br />
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)<br />
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)<br />
	at javax.mail.Service.connect(Service.java:275)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:382)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:335)<br />
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:331)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:595)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendToDestinations(ReportExecutionJob.java:357)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:278)<br />
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:148)<br />
	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)<br />
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)<br />
Caused by: java.net.ConnectException: Connection refused: connect<br />
	at java.net.PlainSocketImpl.socketConnect(Native Method)<br />
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)<br />
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)<br />
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)<br />
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)<br />
	at java.net.Socket.connect(Socket.java:516)<br />
	at java.net.Socket.connect(Socket.java:466)<br />
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)<br />
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)<br />
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)<br />
	... 11 more<br />
</td></tr></tbody></table><br />
i tried to change the js.mail.properties and add the property too. but still the same error message. is there anybody know how to fix it?<br />
thanks in advance.<br />
<br />
Best regards.<br />
<br />
Kelly
kelly's picture
1828
Joined: Jun 26 2007 - 4:12am
Last seen: 16 years 3 months ago
Based on the stack trace it seems that you're either connecting to the wrong smtp server address and/or port. Verify those first.

Also make sure that the mailing info you provided during install are correct since there was a bug in which the settings wasn't transfered to the properties file properly (not sure of what version you're using).

The file is at [tomcat dir]/webapps/jasperserver/WEB-INF/js.mail

Hope that helps!
Post edited by: javydreamercsw, at: 2007/07/20 11:56
javydreamercsw's picture
Joined: Jul 17 2006 - 9:46pm
Last seen: 6 years 11 months ago


Lucien! This worked for me! Karma for you :-)
I repeated your post here:
http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=71124#71175



Post Edited by franzkrauth at 23/02/2010 08:31
franzkrauth's picture
Joined: May 19 2008 - 4:35pm
Last seen: 4 years 10 months ago

Hello good people!

i know this thread is old and i've seen some slight differences in files which are supposed to  be edited in the version 3.7 which are js.quartz.properties and applicationContext-report-scheduling. what differences i've seen here,  is at the applicationContext-report-scheduling level :

<prop key="mail.smtp.starttls.enable">true</prop> is that ok just to add it?
highjo's picture
374
Joined: Dec 17 2009 - 9:18am
Last seen: 9 years 11 months ago

I think so. Try it and see.

 

Sherman
Jaspersoft

swood's picture
24621
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago

Hello thanks for replying this.I 've realized that to use tls the port number has to be 587, and i just happened to noticed that it was said earlier.So after making that change i started having an entry in the the jasperserver.log file which i put with this poste.so is it a common error on jasperserver or it's has to go with my environement?anyway how to fix it? thanks for reading this

Code:
2010-03-02 16:53:14,677 ERROR ReportExecutionJob,quartzScheduler_Worker-1:308 - An error occurred while sending job error notification.
org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
javax.mail.MessagingException: IOException while sending message;
  nested exception is:
	javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1879321.1267548791209"
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:625)
	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:1259)
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:445)
	at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:231)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1879321.1267548791209"
	at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:870)
	at javax.activation.DataHandler.writeTo(DataHandler.java:301)
	at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
	at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1683)
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:585)
	... 8 more</td></tr></tbody></table>
highjo's picture
374
Joined: Dec 17 2009 - 9:18am
Last seen: 9 years 11 months ago

Hmmm, this could be an issue with using JDK 1.6. See this thread http://old.nabble.com/javax.activation.UnsupportedDataTypeException:-no-object-DCH-for-MIME-type-multipart-mixed-td12523671.html

 

Are you using JDK 1.6? If so, it looks like the workaround (from the above post) is to move the mail.jar from WEB-INF/lib to tomcat/common/lib (Tomcat 5.5) or tomcat/lib (Tomcat 6.X)

 

 

 

 

Sherman

Jaspersoft

swood's picture
24621
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago

 hi folks,

i am getting below error when i tried to send email from jasper.

org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.localhost.com, port: 25;

  nested exception is:

java.net.ConnectException: Connection refused: connect

in js.quartz.properties file:

report.scheduler.mail.sender.host=smtp.nandimsg.sonata.local.com

report.scheduler.mail.sender.username=chandrasekhar.k

report.scheduler.mail.sender.password=Lord@10c

report.scheduler.mail.sender.from=chandrasekhar.k@sonata-software.com

report.scheduler.mail.sender.protocol=smtp

report.scheduler.mail.sender.port=25

 

report.scheduler.web.deployment.uri= http://localhost:8484/jasperserver

 

in application-context-report-Scheduling.xml

<property name="javaMailProperties">

            <props>

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

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

            </props>

        </property>

i tried with gmail settings as well for the above 

 

scheduling is working fine as set but email is not working

where i am doing wrong,

please help me to find where exactly the problem.

 

thanks much

 

 
NandiniBC's picture
172
Joined: Apr 8 2011 - 2:00am
Last seen: 2 years 3 months ago

 hi email notification in jasper is working now.

when any organization using exchange server for mail communication dont use smtp as prefix for the host name.

 

please see the below working configuartion 

 

 

Code:
report.scheduler.mail.sender.host=webmail.sonata-software.com
 
report.scheduler.mail.sender.username=chandrasekhar.k
 
report.scheduler.mail.sender.password=Lord@10c
 
report.scheduler.mail.sender.from=chandrasekhar.k@sonata-software.com
 
report.scheduler.mail.sender.protocol=smtp
 
report.scheduler.mail.sender.port=25
 
 
 
report.scheduler.web.deployment.uri=http://localhost:8484/jasperserver</td></tr></tbody></table>
NandiniBC's picture
172
Joined: Apr 8 2011 - 2:00am
Last seen: 2 years 3 months ago
Feedback