Problem decoding an email

Giganews Newsgroups
Subject: Problem decoding an email
Posted by:  Lis (lis@despammed.com)
Date: Tue, 8 Jun 2004

Hi,
  I use Indy 10 (snapshot downloaded on 31/5) and I notice that works much better than release 9 decoding mails.
The only problem I found in some days of normal use of my application is related to the email that I will attach to a message in this thread.
After retrieving the message, the IdMessage object contain 5 parts: 4 TIdText and 1 TIdAttachmentFile, but the mail contain 2 Attachments.

Is this a known bug? I read the mail in this way:

if POP3.Retrieve(MsgIndex, Msg) then begin
  if Msg.MessageParts.Count > 1 then begin
    for i := 0 to Msg.MessageParts.Count - 1 do begin
      if Msg.MessageParts.Items[i] is TIdText then begin
        //is Text part?
        if AnsiStartsText('text/html', Msg.MessageParts.Items[i].ContentType) then
          //treat html text
        else
          //treat normal text
      end else if Msg.MessageParts.Items[i] is TIdAttachmentFile then begin
    //treat attachment
      end;
    end; //for i := 0 to Msg.MessageParts.Count - 1
  end;
end;

--
Lis
Mercatino:http://snurl.com/sito_lis
Aiuta la ricerca contro il cancro:http://snurl.com/ida_team

Replies