Handling basic errors before sending an email