Hi Arno Thank you for this - it turns out you were correct. Once my message pump was corrected it worked.
I still need a handler on OnDisplay that sleeps for 2 milliseconds, but everything is working reliably now. I've put through a ton of emails this morning and everything has worked out OK. I'll make sure my message pump code is OK from here onwards. Thanks a lot, Pete > From: arno.garr...@gmx.de > To: twsocket@elists.org > Date: Thu, 27 Aug 2009 08:41:12 +0200 > Subject: Re: [twsocket] Problem sending larger attachments > > Pete Williams wrote: > > I'll post the code tomorrow, but before then... > > > > - The RTC component is on a TDataModule, which is created in the > > Execute() method of the thread in which it runs. > > - The Connect method is called from the same thread as it's > > constructor, I'm not mixing threads. > > You do not check message's HWND member. If your custom > message IDs EMAIL_GATEWAY_TICK .. EMAIL_GATEWAY_QUIT are not > unique they may conflict with message IDs used by TSmtpCli > (or RTC?) internally. > > while not Terminated do > begin > if not GetMessage(Msg, 0, 0, 0) then > break; > if Msg.Hwnd = 0 then // PostThreadMessage() => destination HWND = 0 > begin > case Msg.Message of > EMAIL_GATEWAY_TICK : ; > [..] > else > TranslateMessage(Msg); > DispatchMessage(Msg); > end; > end > else begin // Dispatch window messages > TranslateMessage(Msg); > DispatchMessage(Msg); > end; > end; > > -- > 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 _________________________________________________________________ Windows Live Messenger: Happy 10-Year Anniversary—get free winks and emoticons. http://clk.atdmt.com/UKM/go/157562755/direct/01/ -- 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