Add error detection for smtp