Article View: borland.public.cppbuilder.internet.socket
Article #2988Re: Get message contents as plain text
From: Remy Lebeau (TeamB)
Date: Mon, 05 Dec 2005 18:22
Date: Mon, 05 Dec 2005 18:22
27 lines
2159 bytes
2159 bytes
"Paulo Tesche" <pstesche@gmail.com> wrote in message news:43944285@newsgroups.borland.com... > The messages are sent with Microsoft Outlook, so they come in > either plain tex, HTML or RTF format. If they are received in > HTML ou RTF, how can I convert it to plain text? Usually, HTML messages contain a plain-text version of the content as well as the HTML version. When available, you can access the plain-text version directly. It is stored in a separate TIdText object in the TIdMessage::MessageParts collection. When the plain text is not available in the message, then you'll have to convert the HTML itself. You will have to do that separately yourself, that is beyond the scope of Indy. In the case of RTF, Outlook sends RTF is a non-standard format that Indy 9 does not recognize at all. The content will arrive in a binary attachment of type "application/x-ms-tnef", usually named ATT00000.DAT or WINMAIL.DAT. You will have to open and decode the attachment manually. There are third-party libraries available for that (Indy 10 has a class for that as well), or you can look up the TNEF format specification at MSDN and write your own decoder. Gambit
Technical Details
Message-ID:
<43948770$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43944285@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f67b0f781468066f X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <43944285@newsgroups.borland.com> Subject: Re: Get message contents as plain text Date: Mon, 5 Dec 2005 10:22:58 -0800 Lines: 29 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <43948770$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1133807472 68.69.17.41 (5 Dec 2005 10:31:12 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail