Improvements on SMTP error handling