Month: April 2012

tcPrettyEmail TeamCity plugin now supports STARTTLS

Posted on Updated on

A recent commenter on the blog mentioned that using a gmail address as the sender address from the tcPrettyEmail plugin was not working due to the fact that wants to use TLS.

I had a quick look through the javax.mail API docs and a browse over stackoverflow, and found that enabling STARTTLS support would be relatively simple. I’m using the spring mail wrapper because it’s bundled with TeamCity, and found that you can pass in extra options using a standard JavaProperties object.

So a few extra lines of code to support the extra tag in TeamCity’s main-config.xml file was all that was really needed to enable it.

While I was pushing a new version, I fixed a couple of missing image files that were causing messages to fail for some less common email message types.

The new version is uploaded to the sourceforge download page and the docs updated to include the new field.

The enable starttls, simply add an argument to the smtp tag (nested inside pretty-email) in main-config.xml. You will probably need to add your username and password to the file as well. Here is an example using gmail as the sender:

    <smtp host="" port="587" 
          from-name="Friendly Name" 
          starttls-enabled="true" />

For futher detail, please see the documentation.