Hello:
If I understand correctly, you send the Quit()
command after a failure and then try CheckNewMail()
again? You must wait for the Quit() command to
complete, it will trigger OnRequestDone with an error
code. You should try something like this instead:
(Mind you, this is out of the top of my head, so I
can't guarantee it will compile or that its the best
way; it is just intended to offer an idea on how to
handle the errors.)
Procedure TMailAlert.Pop3ClientRequestDone;
Begin
// NOTE:
// ErrorCode and ReqType are params
// of the OnRequestDone event.
// No error, send the next cmd.
If (ErrorCode <> 0) Then Begin
Case ReqType Of
pop3Connect : FPop.User;
pop3User : FPop.Pass;
pop3Pass : FPop.Uidl;
// ...
End;
// There was an error, try to
// fail gracefully.
End Else Begin
// If the failure was during Quit,
// we need to abort to reset the
// component.
If (ReqType = pop3Quit) Then
FPop.Abort
// Otherwise, quit gracefully if
// still connected.
Else If (FPop.Connected) Then
FPop.Quit;
End;
End;
>------- Original Message -------
>From : [EMAIL PROTECTED]:[EMAIL PROTECTED]
>Sent : 12/12/2007 12:21:45 PM
>To : [email protected]
>Cc :
>Subject : RE: Re: [twsocket] pop3 component not ready
>
>procedure TMailAlert.CheckNewMail;
begin
with FPop do
if not Connected then
begin
Fbusy := true;
ClearErrorMessage;
Connect;
end;
end;
as you see, the pop component is not connected when i
do the connect
cmd. that's the strange thing, the connection is
closed but the
component is not in a ready state.
--
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