Problems getting the Email (tokens template v3.1)module to work

0
Even after going over all threads on Email in the Forum (which for a great many post I guess are probably not applicable to 4.4.4) I am still kinda stuck. The documentation in the appstore seems to be lacking some parts, like examples on how to set it up to work properly in eg. local modeler and Mendix Cloud. Then there are some ambivalnt posts on what to put in the settings, which only confuse the issue more! So could someone please enlighten me on this!! (and then make sure the documentation in the appstore is adjusted too?!) Just to make sure, IF I want this to work in the public Cloud, do I need to put in a support request ?? The error I am getting seems to point to a security issue ? Blockquote com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: Unable to send email. at com.mendix.core.Core.execute(SourceFile:232) Caused by: com.mendix.core.CoreException: Unable to send email. at hC.b(SourceFile:218) 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:25 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:132) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:24) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at ln.a(SourceFile:69) at mt.a(SourceFile:72) at ms.a(SourceFile:151) at ms.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at gn.execute(SourceFile:186) at jd.a(SourceFile:319) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192) Caused by: access denied (java.net.SocketPermission localhost resolve) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031) at java.net.InetAddress.getAllByName0(InetAddress.java:1145) at java.net.InetAddress.getAllByName(InetAddress.java:1083) at java.net.InetAddress.getAllByName(InetAddress.java:1019) at java.net.InetAddress.getByName(InetAddress.java:969) at javax.mail.URLName.getHostAddress(URLName.java:473) at javax.mail.URLName.hashCode(URLName.java:449) at java.util.Hashtable.get(Hashtable.java:334) at javax.mail.Session.getPasswordAuthentication(Session.java:811) at javax.mail.Service.connect(Service.java:258) at javax.mail.Service.connect(Service.java:156) at javax.mail.Service.connect(Service.java:105) at javax.mail.Transport.send0(Transport.java:168) at javax.mail.Transport.send(Transport.java:98) 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:132) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:24) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at ln.a(SourceFile:69) at mt.a(SourceFile:72) at ms.a(SourceFile:151) at ms.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at gn.execute(SourceFile:186) at jd.a(SourceFile:319) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192)
asked
1 answers
0

Lex, first make sure you can send normal mails from local and from the cloud. These are two very different settings so you have to make sure that mails are sended. Unless I misread the error above it looks like you are unable to send due to a password authentication error.

If normal mails can be sended it is time to make the adjustments for the templates. The problem with the templates is that you need an enumeration that can be used to branch upon what kind of mail template you want to send. Because with one template I want to have the data from the user object while the other I need an other entity of my domain model. In the example MF (IVK_CreateAndSendEmail) you see an example entity Customer and Order, but you need to set your own objects here you want to have available in your templates.

I always copy this microflow to outside this module and turn the example MF off so you do not have problems when upgrading this module. Then change this MF to your own needs.

When creating templates you have to make sure that each template is only used once. For this is the OC_TemplateTypeAlreadyInUse. Do the same as the other MF copy it outside the module adapt and exclude the original one.

When creating emails make sure you have the right template and the right objects and that these objects have data in them. This module does work in the standard cloud, but you have to make sure you have latest version because there are some library changes done. Also make sure you have the latest model reflection.

Hope this helps,

Regards,

Ronald

answered