HTML Email from Clojure

As mentioned in my other post about plaintext emails, I recommend using the Apache Commons Email library when sending email from Clojure apps.  First up, you need to add the dependency to ‘project.clj’

Next, your HTML email has both an HTML version and the alternative plaintext version of the email. Notice, all you have to do is create an instance of HtmlEmail and then call the set and send methods on it using ‘doto’. Pretty easy.

There are more examples and the javadocs over at the Apache Commons site. However, this should be a basic enough example to get you started.

 

 

 

Leave a Reply

Your email address will not be published.