Finishing mailer functionality, fixes #11