Re: Using Indy10 SMTP server and beyod
Hi
It's me again.
I have been trying to find a way to retrieve information from a MIME
email message.
for instance I use IdPop3.RetrieveRaw(n, sList) to read a mail from
a POP3 mail server. All data are saved in sList (TStringList). I
then try to parse the message using TIdMessage.
sList.SaveToFile('tempFile.txt');
IdMessage.LoadFromFile('tempFile.txt');
[red]IdMessage.MessageParts.CountParts;[/red]
and then I go through each part:
TIdMessagePart part := IdMessage.MessageParts.Items;
I get the right information from:
part.PartType
for k:=0 to part.Headers.Count-1 do
begin
name := part.Headers.Names[k];
sValue := part.Headers.Values[name];
end;
so I know which part is body text and which part is an attachment
(and the file name).
老外的代码,works fine,自己参考。