smtp error handling moved