The SendEmail java action need a value in Email.PlainBody, make sure this attribute isn't empty. When empty, you could copy the content of Email.HtmlBody, or set it to ' '.
Could there be a conflict in the libraries you're using (so in the userlib folder) ? It seems weird you'd get a cast error here.
Bas, did some further investigation. Read on the internet about activation.jar (http://stackoverflow.com/questions/2976985/com-sun-mail-handlers-text-plain-cannot-be-cast-to-javax-activation-datacontenth). Excluding com.springsource.javax.activation-1.1.1.jar in userlib from the project does give a change. Sending an email still gives an error but now the message is:
Failed to send an email to: luch.klooster@fraternit.com an error occured in the SendEmail java action
Error message smtp
Triggered in MF IVK_CreateAndSendEmail
Stacktrace
com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: Unable to send email.
at com.mendix.core.component.InternalCore.execute(SourceFile:274)
Caused by: com.mendix.core.CoreException: Unable to send email. at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:216)
Caused by: Unable to send email. at emailtemplate.mail.EmailModule.mail(EmailModule.java:128)
Full stacktrace
Failed to send an email to: luch.klooster@fraternit.com an error occured in the SendEmail java action
Error message smtp
Triggered in MF IVK_CreateAndSendEmail
Stacktrace
com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: Unable to send email.
at com.mendix.core.component.InternalCore.execute(SourceFile:274)
Caused by: com.mendix.core.CoreException: Unable to send email. at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:216)
Caused by: Unable to send email. at emailtemplate.mail.EmailModule.mail(EmailModule.java:128)
Caused by: Sending the email to the following server failed : localhost:2525 at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1401) at org.apache.commons.mail.Email.send(Email.java:1428) at emailtemplate.mail.Sender.send(Sender.java:101) at emailtemplate.mail.EmailModule.mail(EmailModule.java:126) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:133) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.hx.execute(SourceFile:42) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SourceFile:33) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.iS.a(SourceFile:135) at com.mendix.pf$g.apply$mcV$sp(SourceFile:292) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(SourceFile:155) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(SourceFile:153) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(SourceFile:146) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: smtp at javax.mail.Session.getService(Session.java:798) at javax.mail.Session.getTransport(Session.java:720) at javax.mail.Session.getTransport(Session.java:660) at javax.mail.Session.getTransport(Session.java:640) at javax.mail.Session.getTransport(Session.java:697) at javax.mail.Transport.send0(Transport.java:192) at javax.mail.Transport.send(Transport.java:124) at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1391) at org.apache.commons.mail.Email.send(Email.java:1428) at emailtemplate.mail.Sender.send(Sender.java:101) at emailtemplate.mail.EmailModule.mail(EmailModule.java:126) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:133) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.hx.execute(SourceFile:42) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SourceFile:33) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.iS.a(SourceFile:135) at com.mendix.pf$g.apply$mcV$sp(SourceFile:292) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(SourceFile:155) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(SourceFile:153) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(SourceFile:146) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
I just updated the e-mail module with templates to the latest version. This solves the problem on my application.
Version 5.0.1. of module EmailTemplate solved the problem.