Pither.com / Simon
Development, systems administration, parenting and business

Add an SMTP server to a Grails application

Quite a long time ago I talked about setting envelope sender addresses so that I could send mailshots and get back any bounces in a useful way. The missing component to it was to process those bounces within my application. Here, finally, is my write up of how I did this.

After much searching I eventually found the excellent SubEtha …


grails-mail patch for envelopeFrom (VERP)

I have previously written about setting envelope senders when sending email in grails and following comments made on that post I did actually get around to submitting a patch to the plugin.

However a change to that patch was suggested and before I managed to implement it, the mail plugin underwent a fairly large refactoring which meant I needed to …


Envelope senders for Grails mail plugin (Spring Java Mail)

I would have expected the desire to set a specific envelope sender address for mails from a web-app to be fairly common. However finding information on how to do it with the Grails mail plugin (ie Spring mail (wrappers for JavaMail)) proved much harder than I expected.

In fact, I ended up reading the source code!

It turns out that …


Groovy mail shot

A simple mail shot script in groovy...

Runs on Debian Lenny with just a standard openjdk-6-jdk installed, groovy 1.7.2 added by hand and everything else pulled in by Grape.

#!/usr/bin/env groovy

import groovy.sql.Sql
import groovy.grape.Grape

Grape.grab(group: 'mysql', module: 'mysql-connector-java', version: '5.1.6', classLoader: this.class.classLoader.rootLoader)
Grape.grab(group: 'javax.mail', module: 'mail', version: '1.4.3', classLoader: this.class.classLoader.rootLoader)
Grape.grab(group: 'org.apache.ant', module: 'ant-javamail', version: '1.7.1', classLoader: this.class.classLoader.rootLoader)

def …

Writing HTML email is unpleasant!

Unfortunately I must admit that a nicely formatted HTML email looks rather better and more catchy as a newsletter than a simple string of plain text. This goes against my general email preference, but even I have relented in recent times and started allowing my mail client to display HTML email (although I still never send it)!

So with this …



  • Page 1 of 1