Better error handling when sending an email.