improving error handler on smtp