Trying to do email downloads

Giganews Newsgroups
Subject: Trying to do email downloads
Posted by:  Captain Kirk (abu…@127.0.0.1)
Date: Fri, 14 Nov 2003

I'm trying to download the sender and subject for all the emails on my
server. I've got this far but I'm now stuck. Can anybody help?

procedure TForm1.Button1Click(Sender: TObject);
var c,d,e : integer;
begin
IdPOP31.Host := Edit1.Text;
IdPOP31.Username := Edit2.Text;
IdPOP31.Password := Edit3.Text;
IdPOP31.Connect(c);
if IdPOP31.Connected then
  begin
  e := IdPOP31.CheckMessages;
  Label5.Caption := IntToStr(e);
  for d := 0 to e do
    begin
    IdPop31.RetrieveHeader(d);
    ChecklistBox1.Items.Add(); // here I want to add the sender and subject
    end;
  end;
IDPOP31.Disconnect;
end;

Replies