On Jan 7, 2008, at 06:56, Wilfried Mestdagh wrote: > You call RSet if you have an error. If you have an error just call > Abort > and try later again. Also check on any error, not only between those > values: > > if Error <> 0 then begin > FSmtp.Abort; > SetSomeRetryMechanism; // retry with a timer or by posting a message > Exit; > end;
You could call RSet if the error is between 500..599, which means a protocol error. That way you could start the SMTP session anew. Anything else, you should call abort and retry like Wilfried says: If (Error In [500..599]) Then Begin FSmtp.RSet; Exit; End Else If (Error <> 0) Then Begin FSmtp.Abort; SetSomeRetryMechanism(); Exit; End; // No error occurred, do the normal stuff // ... But don't forget that RSet will reset the session to the point where you logged in, so you should treat it the same as your last log in command, which in your case is Auth: case RqType of smtpConnect: begin if AuthType = smtpAuthNone then Helo else Ehlo; end; smtpHelo: MailFrom; smtpEhlo: Auth; // Rset will return to this point smtpAuth, smtpRset: MailFrom; ... dZ. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be