How to delete emails from POP3 server using Indy?

I would like to delete mail with a specific header or specific sender with INDY 10 / DELPHI. I can already request an email account at INDY10. Here's a demo code:

procedure TForm1.BtnCheckClick(Sender: TObject);
var
  i: Integer;
  Msg: TIdMessage;
  MailCount: Integer;
begin
  if IdPop31.Connected then
  begin
    MailCount := IdPOP31.CheckMessages;
    lbMailCount.Caption := IntToStr(MailCount);
    lbMailboxSize.Caption := IntToStr(IdPOP31.RetrieveMailBoxSize) + ' Bytes';

    for i := 1 to MailCount do
    begin
      Msg := TIdMessage.Create;
      try
        IdPOP31.RetrieveHeader(i, Msg);
        MailsList.Lines.Add(Msg.Subject + ' from ' + Msg.From.Text);
      finally
        Msg.Free;
      end;
    end;
  end;
end;

      

+3
delphi indy indy10


source to share


No one has answered this question yet

See similar questions:

0
Indy9 Get Raw Email Header?

or similar:

five
indy GET download speed
4
Using COM DLL in delphi - Access Violation in MSVCR80D.dll
1
How to get TQuery en Delphi results?
1
Why does IdSMTP.Send fail if only one email address is invalid?
1
How to create a simple dictaphone panel in Delphi2009 + Vista
1
Select cell in TAdvStringGrid with hidden columns
0
ProgressBar In subtopic tListview Delphi
0
Post values ​​in HTML forms without using TwebBrowser
0
Delphi Indy component sending mail using gmail doesn't send it to some addresses
0
More header information from Indy post



All Articles
Loading...
X
Show
Funny
Dev
Pics