generic email sending boilerplate