mail error handling