Pulled out email sending into its own file