Work on mailer (added lots of tests too).