Wiring up email functionality