testing a new version of mailer.rb based on https://gist.github.com/grepory/11409074