POP3->Retrieve()

Giganews Newsgroups
Subject: POP3->Retrieve()
Posted by:  duf (d…@wp.pl)
Date: Sun, 28 Sep 2008

Is there a way to stop receive mail while this process is working ?

for( int i = 1; i <= news; ++i )
{
    Form1->IdMessage1->Clear();
    Form1->POP3->Retrieve( i, Form1->IdMessage1 ); // <-- this method

    for( int j = 0; j <= Form1->IdMessage1->MessageParts->Count-1; ++j )
    {
      TIdAttachment *Attachment = dynamic_cast<TIdAttachment*>( Form1->IdMessage1->MessageParts->Items[j] );

      if( Attachment )
      {
        Form1->Label1->Caption = Attachment->FileName;

        Form1->POP3->Delete( i );
        break;
          }
        }
}

Method "POP3->Disconnect()" generates error.

Replies