Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jun : Pop with a html part

www.cryer.info
Managed Newsgroup Archive

Pop with a html part

Subject:Pop with a html part
Posted by:"Donald Bossen" (sboss..@jbimporters.com)
Date:Tue, 28 Jun 2005 14:01:23

Here is the Code I use to Get Messages.
     try
       IdPop.Retrieve(x,Msg);
       CType := copy(Msg.ContentType,1,Pos('/',Msg.ContentType)-1);
       if UpperCase(CType) = 'MULTIPART' then
         for BdyCnt := 0 to pred(Msg.MessageParts.Count) do
           begin
             if (Msg.MessageParts.Items[BdyCnt] is TIdAttachment) then
               begin
                 // Handle attached file
               end
             else
               begin
                 if Msg.MessageParts.Items[BdyCnt] is TIdText then
                   begin
                     // handle text part of message
                     // Here I loop through the Body of BdyCnt
                     // for x = 0 to bodylineCnt
                   end
               end;
           end
       else
         begin
           // Handle single Part Messages
         end;
       IdPop.Delete(x)
     except
       FldList.Items.Append('Exception raised in message Extction');
     end;
I am getting email that has a section I don't know how to read.
It traces through as MultiPart with only one Count. This ia a 3 line
text message that says "Your order information is attached as an HTML
document" I can print this through netscape and see the above message
after the header followed by --%_======_next_part____735401428.6
Content-Type: text/html; charset="iso-8859-1" This is followed by html
code. How can I get to this HTML code to parce it out and retrive the
data I need. Indi 9 Delphi 6
Thanks
Donald S. Bossen

Replies:

www.cryer.info
Managed Newsgroup Archive