|
Internet Direct (Indy) Version 9.0.1 Beta
|
property NoDecode: Boolean;
When NoDecode is True, the message will be retrieved and added to MessageParts as MIME-encoded attachments. There will be one MessagePart (TIdText type) added for the message Body, and additional MessagePart items (TIdAttachment type) for each message attachment. Body will be empty.
To read a message for a POP3 client, you can use the following code:
Msg.NoDecode := false;
APOP.Retrieve(1, Msg);
for i := 0 to Pred(Msg.MessageParts.Count) do
begin
//general attachments
if (Msg.MessageParts.Items[i] is TIdAttachment) then
begin
lstAttachments.Add(TIdAttachment(Msg.MessageParts.Items[i]).Filename);
end
//body text
else
begin
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Memo1.Lines.AddStrings(TIdText(Msg.MessageParts.Items[i]).Body);
end
end;
end;
When NoDecode is False, the message will be retreived and the message body is stored in Body in its MIME-encoded form.