Page 1 of 1

Mail usage problem on workflow

PostPosted:Tue Jan 08, 2013 2:23 pm
by mammacori
Hy all,
i'm tryng to set up a simple workflow whose main goal is to checkin a document with categories and some other metadata.
At the end of the process the workflow should send an email to an user; at this step no matter the user is... the important thing is that the process will make sense.

after the task node in charge to checkin i created a node mail with the following code
Code: Select all
<mail-node name="mail-node1" to='user@gmail.com' subject='notifica da openkm' text='ho inserito un nuovo file'>
<transition to="end-state1" name="route 4"></transition>
</mail-node>
in the /opt/openblablabla/tomcat/conf/server.xml file i configured the following
Code: Select all
 <Resource name="mail/OpenKM" auth="Container" type="javax.mail.Session"
            mail.transport.protocol="smtp"
            mail.smtp.auth="true"
            mail.smtp.host="smtp.gmail.com"
            mail.smtp.port="465"
            mail.smtp.user="user@gmail.com"
            password="secretword"
            mail.smtp.from="user@gmail.com"
            mail.smtp.quitwait="false"
            mail.smtp.starttls.enable="true"
            mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
            mail.debug="true"
    />
but when i run the workflow i get the following error
Code: Select all
ERROR org.jbpm.mail.Mail - Cannot send mail, now retrying: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
it seems that openkm doesn't load the current parameters stored in server.xml above

where do i'm wrong ? do i miss something ?
i searched in the blog and in the web but i didn't find any help :(
Alessandro

Re: Mail usage problem on workflow

PostPosted:Wed Jan 09, 2013 7:20 pm
by jllort
The most easiest way to send some mail is use OpenKM MailUtils.java http://doxygen.openkm.com/6.2.x/d4/d5a/ ... utils.html

In a transaction use this class to send mails ( it's more easy than configure jbpm for doing it ).