Tuesday, July 26, 2011

Sending Email Using PostMark

Having your webapp send out emails, is well, according to me, a tricky issue. Its definitely a convenience for your users, as long as, there is no delay in receiving the mail. But beware, that delay can make or break the functionality!

When we first tried using the SMTP server of CityNaksha, we were happy for the functionality, but absolutely disheartened with the mail delivery! After a while, the delays were piling up to a couple of hours! It was completely unacceptable.

A couple of days and a question on StackOverflow later, Postmark came to the rescue! And well, till now, we are happy with the result. Here's a quick primer, compiled from the notes that I was jotting down, while implementing Postmark for out webapp.

We run on Java, with Struts.
  1. Signup on Postmark and create an account there. They have a package of 1,000 free emails to help you set things up
  2. There are a host of plugins you can choose from. For Java, we used Jared Holdcroft's library
  3. I couldn't locate a combined jar file in there, so had to put all the source files in my project, and the associated jar's in the build path of the project and the WEB-INF/lib location
  4. The code snippet from the test file, is quite helpful
We have been using it for a few days now, and are quite happy with the performance. The integration didn't take much time either.

Overall rating : 4/5 stars

Lets keep connecting the city.
RD,
Facilitator, CityNaksha.