Receive mail with attachment (indy 9)

Giganews Newsgroups
Subject: Receive mail with attachment (indy 9)
Posted by:  duf (d…@wp.pl)
Date: Thu, 27 Mar 2008

I cannot find code for receive mail with attachment. I try do it with something like this:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int    ilosc_wiad = 0, ile_zal = 0;
  string  zal_nazwa;

  OptionsSet();

  POP3Client->Connect();
  ilosc_wiad = POP3Client->CheckMessages();
  POP3Client->Retrieve( ilosc_wiad, IdMessage1 );

  IdMessage1->Clear();
  ile_zal = IdMessage1->MessageParts->Count-1;

  ............................................

  POP3Client->Disconnect();
}
but I do not know how can I get name of attachment ( zal_nazwa ) and how to save file.

Replies