Hello Max, Use OnRequestDone to trigger next sending, not OnStateChange or OnSessionClosed. Both latter are more for log or display updates.
--- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, July 29, 2006, 11:48, Max Terentiev wrote: > Helo, > What is a best event for starting new Smtp session (e.g. > start sending next message after previous is sent or aborted)? > I was try to Use OnSessionClosed or OnStateChange events > (in OnStateChange i wait for SmtpCli->State==smtpReady and Smtp->>CtrlSocket->State=wsClosed). > But anyway i receive folowing errors time to time: > 1. Smtp component not ready > 2. Error in function WSACancelAsyncRequest - Invalid Argument > 3. Smtp component already connected > 4. Can't change socks port if not closed. > This errors happens time to time (program can work minutes or hours before > it). > I not understand why it's happens ? > After sending message (or getting smtp protocol error during sending > message) I ALWAYS Call SmtpCli->Abort() and wait in OnStateChange > until connection closed and component is ready. After it I prepare next > message and call SmtpCli->Connect(), etc. > Why I receive errors 1-4 ?? Maybe I must do something special ? How i > can ensure what connection is 100% closed and component 100% ready for next > session ? > I NOT use Application->ProcessMessages inside SmtpCli events. > Please help... And excuse me for bad english. > --- > With best regards, Max Terentiev. > Business Software Products. > AMS Development Team. > [EMAIL PROTECTED] -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be