Monday, May 28, 2012

Setting up Grails email using Amazon Web Services (AWS) Simple Email Service (SES)

So, I was having some issues with the limitations on using Zoho, and decided to branch out and try making things work with AWS SES. I found this great tutorial on how to use SES without installing any plugins other than the standard Mail plugin. While the tutorial was well-written, it didn't work. I got errors indicating that Grails didn't know how to process the following config.groovy line:

grails.mail.protocol = 'aws'

So, I decided to try a tutorial that used the AWS plugin. I finally got this working, but had to learn by trial-and-error that there was a missing dependency on the AWS SDK for Java. I added the files aws-java-sdk-1.3.2.jar, httpclient-4.1.1.jar, and httpcore-4.1.jar from that SDK plus the jets3t-0.9.0.jar file from the JetS3T SDK, and then things worked.

I plan to use this in many future projects, so I'm posting these as a reminder to myself, but hopefully they'll help someone else, too!