Added emailing capabilities with tests