cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.1: Mail node.

jcosano
Champ in-the-making
Champ in-the-making
Mail is sended but, when I receive mail: To and Subject are empty (but I Receive mail) and mail has:

——=_Part_0_23097584.1294403453741
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


=09=09       =20
=09=09        <html>
            =09<body>
=09=09        <table>
…………………MAIL…………………….
                  </table>
=09=09=09=09</body>
          =09=09</html>
=09=09       =20
=09=09    
——=_Part_0_23097584.1294403453741–
11 REPLIES 11

jcosano
Champ in-the-making
Champ in-the-making
Really is working fine html mails in activiti 5.1?

——=_Part_0_17089934.1294647325891
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit



                                <html>
                        <body>
                               Hello
                       </body>
                       </html>


——=_Part_0_17089934.1294647325891–

jbarrez
Star Contributor
Star Contributor
We have a test case that asserts that those fields are populated when sending an email.

Can you post a testcase or process snippet so we can verify?

jcosano
Champ in-the-making
Champ in-the-making
If I replace this code in EmailSendTaskTest

     <sendTask id="sendMail" activiti:type="mail">
    <extensionElements>
         <activiti:field name="from" expression="${sender}" />
         <activiti:field name="to" expression="${recipient}" />
      <activiti:field name="subject" expression="Peti" />
      <activiti:field name="html">
        <activiti:expression>
          <![CDATA[
            <html>
               <body>
                 Hello
                </body>
                </html>
          ]]>
        </activiti:expression>
      </activiti:field>     
    </extensionElements>
  </sendTask>  

Mail works fine… and all correct…

But this node running under Activiti Explorer environment
——=_Part_0_32790978.1294676055063
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit


             
                  <html>
                   <body>
                       Hello
                    </body>
                    </html>
             
           
——=_Part_0_32790978.1294676055063–

jcosano
Champ in-the-making
Champ in-the-making
This is a process with start form, that ask for email address, and send mail…

If this process is launch from Activiti Explorer, mail is sended but with empty values and strange body.

jbarrez
Star Contributor
Star Contributor
I dont see anything wrong with your configuration.

I have a demo here that sends an email from Explorer, whichj I can perfectly receive in my mail client. This is my config:


<serviceTask id="sendRejectionEmail"  name="Send rejection e-mail" activiti:type="mail" >
      <extensionElements>
        <activiti:field activiti:name="from" stringValue="mortgage-applications@activiti.org" />
        <activiti:field activiti:name="to" stringValue="${emailAddress}" />
        <activiti:field activiti:name="subject" stringValue="Your mortgage loan application has been rejected" />
        <activiti:field activiti:name="html">
          <activiti:string>
            <![CDATA[
              <html>
                …
            ]]>
          </activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>

jcosano
Champ in-the-making
Champ in-the-making
I reinstall all.. and same result, mail is sended but with blank fields…

When I launch testCase and email is fine has 3 body:
body1:
"Content-Type: multipart/mixed;
boundary="—-=_Part_4867_1662845127.1294749379259"
"
body2:
"——=_Part_4867_1662845127.1294749379259
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-15

"
body3:
"
——=_Part_4867_1662845127.1294749379259–
"

Email wrong has only 1 body
"
——=_Part_0_986215.1294757588033
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

——=_Part_0_986215.1294757588033–
"


Strange it's testcase works, but running under explorer fails…

frederikherema1
Star Contributor
Star Contributor
For emailing, we use commons-email, this uses Java Mail API.

Perhaps it behaves different inside tomcat-environment, with different java-mail implementation than the one when running on a bare JDK…

jcosano
Champ in-the-making
Champ in-the-making
Ok!!!!

I found the problem…..

Under:
activiti\apps\apache-tomcat-6.0.29\webapps\activiti-rest\WEB-INF\lib

I have:
geronimo-activation_1.0.2_spec-1.1.jar
geronimo-activation_1.1_spec-1.0.2.jar
geronimo-javamail_1.4_spec-1.3.jar

I delete these 3 files… and now is working… then…

I suppose that this problem is generic… because I install from start…

The question is…
Really are needed these files?

jbarrez
Star Contributor
Star Contributor
That's really strange that I havent bumped into that problem, because I didnt need to delete them.
Activiti also ships with those libraries (but different version, not the geronimo ones)

Good to know, thanks for sharing.