Hi, and thanks for your fast reply. What do you mean with " ...post a custom message and from its handler call sendMail." ?
Best regards, Stefan 2010/7/7 Arno Garrels <arno.garr...@gmx.de>: > Stefan Göppert wrote: >> Hi, >> >> I try to send multiple E-Mails (single Mails, one after another). >> After a while (mostly if 380 E-Mails where send) I get an SMTP >> component not ready error. What can I do in this case? >> >> Here some code: > [..] > smtpQuit : begin > [..] >> sleep(500); > > Do not call sleep, it's useless. > >> if whereIam > -1 then >> sendMail(whereIam) > > Do not call sendMail here, instead post a custom message and > from its handler call sendMail. In sendMail check whether > the connection is closed, or handle event OnSessionClosed > as well. > >> else >> ShowMessage('ok'); > > Do not call ShowMessage() from event handler, it processes > messages which could lead to reentrance into the handler or to > other unwanted results. > > -- > Arno Garrels > > > > -- > 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 -- 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