Thursday, January 24, 2008

emailing from grails

The sendMail Method on page 270 of DGG (Definitive Guide to Grails) has a method used in the subscription controller that is run from a job. The method (sendMail) takes a user a subject and a bodyContent Closure and sends it using the org.apache.commons.mail.HtmlEmail package.

Should work for the WebTest app with some tweaks. Better then the Spring thing that I tried from the tutorial on the grails site. That one seems to be very old since Grails has progressed alot...Thought the book is old too and has problems.

It works! Except I can't email from windows, only linux WTF... Hard to only work in linux, but I can do some stuff.

No comments: