Schau Dir doch mal das MailClient Beispiel an...
Delphi-Quellcode:
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin //general attachment
pnlAttachments.visible := true;
li := lvMessageParts.Items.Add;
li.ImageIndex := 8;
li.Caption := TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
// li.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType);
end
else
begin //body text
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
end
end;
end;
CU Frank