Email Example for Thorntail 2.0.0.Final?

165 views
Skip to first unread message

Jan Stamer

unread,
Aug 2, 2018, 10:52:01 AM8/2/18
to Thorntail
Hi,

is there an example or documentation on how to send mails in Thorntail 2.0.0.Final using thorntail-mail?
I saw an example with gradle but from my impression it was not up to date any more.

Thanks a lot,
Jan

fxh

unread,
Aug 2, 2018, 1:38:00 PM8/2/18
to Thorntail

Jan Stamer

unread,
Aug 6, 2018, 2:07:09 AM8/6/18
to Thorntail
Hi,

thanks a lot. When I run the example the injected mail session in the MailEndpoint is null. I am also not able to change the smtp host. When I change the hostname in the yml configuration it still tries to send to localhost. Any ideas?

Thanks,
Jan

Jan Stamer

unread,
Aug 6, 2018, 2:49:03 AM8/6/18
to Thorntail
Hi,

I figured i just use the default mail session with jndi name java:jboss/mail/default and set the smtp server using system properties or env var. That works for me.

Thanks,
Jan

fxh

unread,
Aug 6, 2018, 9:24:52 AM8/6/18
to Thorntail

I just recognized an error in my mail-session configuration. The configuration section should be "swarm.mail.mail-session" - not "mail-session" (indention error). I further failed with the sessions jndi-name which has to be "java:jboss/mail/whatever". I'll update the example asap^^ 


When configured correctly you should get the following output on application start:


2018-08-06 15:17:29,410 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-6) WFLYMAIL0001: Bound mail session [java:jboss/mail/default]

2018-08-06 15:17:29,414 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0001: Bound mail session [java:jboss/mail/whatever]

Reply all
Reply to author
Forward
0 new messages