var
Cuerpo : TIdMessage;
POP3 : TIdPOP3;
begin
with POP3 do
begin
Connect(0);
if CheckMessages > 0 then
begin
Cuerpo := TIdMessage.Create(nil);
for i := 1 to CheckMessages do
begin
Retrieve(i, Cuerpo);
for j := 0 to Cuerpo.MessageParts.Count - 1 do
begin
if (Cuerpo.MessageParts.Items[j] is TIdAttachment) then
begin
EL_FICHERO := TIdAttachment(Cuerpo.MessageParts.Items[j]).Filename;
..
..
..
..