Added mailer

Added mailer functionality, and related test, unittests, and intigration
tests.

This completes ch13