🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
10 messages
10 total messages Started by Paulo Tesche Mon, 05 Dec 2005 14:48
Get message contents as plain text
#2985
Author: Paulo Tesche
Date: Mon, 05 Dec 2005 14:48
6 lines
1279 bytes
I�m using Indy 9 and I need to get the messages contents as plain text to 
search for specific information.
I�m using TIdPOP3 to get the TIdMessage�s.
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? 
Re: Get message contents as plain text
#2986
Author: Peter Evans
Date: Mon, 05 Dec 2005 15:24
22 lines
2000 bytes
Paulo,

I can't speak for the Indy 9 component, but when using NetMaster's C++ 
equivalent the content of the email can be extracted into a String buffer. 
Emails in HTML will have different parts to them, one of which is an ascii 
text part representing the content of the email, but without tags.  You will 
be able to identify this in the buffer and so process it.  Yes, it's not 
Indy, but maybe the method carries over.  Hope it helps.

Best regards, Peter Evans,

PS.  Are you using Delphi or C++?


"Paulo Tesche" wrote in message news:43944285@newsgroups.borland.com...
> I�m using Indy 9 and I need to get the messages contents as plain text to 
> search for specific information.
> I�m using TIdPOP3 to get the TIdMessage�s.
> 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?
> 
Re: Get message contents as plain text
#2987
Author: Paulo Tesche
Date: Mon, 05 Dec 2005 16:45
15 lines
1610 bytes
Thanks Peter,

> I can't speak for the Indy 9 component, but when using NetMaster's C++ 
> equivalent the content of the email can be extracted into a String buffer. 
> Emails in HTML will have different parts to them, one of which is an ascii 
> text part representing the content of the email, but without tags.

Well, I can get the message contents in a String with no problems, but it 
cames with all the formatting tags associated to either HTML or RTF. I need 
the text contents so that I can search it for some specific substrings 
without worryng about any "interference" of tags.


> PS.  Are you using Delphi or C++?
I�m using C++ Builder V6 
Re: Get message contents as plain text
#2988
Author: Remy Lebeau (TeamB)
Date: Mon, 05 Dec 2005 18:22
27 lines
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
Re: Get message contents as plain text
#2991
Author: Paulo Tesche
Date: Mon, 05 Dec 2005 21:10
2 lines
1068 bytes
Thanks Gambit.
Looks like more research work needed by me, isn�t?
Re: Get message contents as plain text
#2994
Author: Peter Evans
Date: Tue, 06 Dec 2005 22:27
39 lines
2843 bytes
Hello again Paulo,

Gambit(TeamB)'s reply is clearly more authoritative than mine on this 
thread, but I would only add the comment that I can _always_ find the 
untagged ascii equivalent of the HTML when using the NM component, and in 
fact use it.  This is _not_ a recommendation for NM at all, as I'm now about 
to engage on dropping NM!  It is only to encourage looking for the untagged 
ascii, if it carried over to Indy.

Thanks for the info regarding you using C++ and Indy.  I do, too, and have 
the impression now that the greater majority of Indy users are Delphi 
oriented (true Gambit?), so to know of other C++ users is helpful.  Do you 
know of more?  (We're supposed not to post email addresses, which I agree 
with, and I wouldn't encourage an off NG 'ring' as it could remove help, if 
there were any available, to others.  We could however alert to a relevant 
NG posting.)

Best regards,

Peter Evans.

"Paulo Tesche" wrote in message news:43945e17$1@newsgroups.borland.com...
> Thanks Peter,
>
>> I can't speak for the Indy 9 component, but when using NetMaster's C++ 
>> equivalent the content of the email can be extracted into a String 
>> buffer. Emails in HTML will have different parts to them, one of which is 
>> an ascii text part representing the content of the email, but without 
>> tags.
>
> Well, I can get the message contents in a String with no problems, but it 
> cames with all the formatting tags associated to either HTML or RTF. I 
> need the text contents so that I can search it for some specific 
> substrings without worryng about any "interference" of tags.
>
>
>> PS.  Are you using Delphi or C++?
> I�m using C++ Builder V6
> 
Re: Get message contents as plain text
#2990
Author: Remy Lebeau (TeamB)
Date: Wed, 07 Dec 2005 01:03
13 lines
1514 bytes
"Peter Evans" <peter-evans@pelcaro.com> wrote in message
news:43961018$1@newsgroups.borland.com...

> the greater majority of Indy users are Delphi oriented (true Gambit?)

The majority of VCL users are Delphi-oriented in general.  Delphi users have
a larger market then BCB users (though C++ has a much larger market than
Pascal).  That's not to say that there aren't a lot of BCB Indy users,
because there are.  Just not with Indy 10 (yet).


Gambit
Re: Get message contents as plain text
#2995
Author: Michael Gillen
Date: Wed, 07 Dec 2005 14:00
9 lines
1153 bytes
Remy Lebeau (TeamB) wrote:

> That's not to say that there aren't a lot of BCB Indy users,
> because there are.  Just not with Indy 10 (yet).

Many of us are getting along just fine with Indy 9 too. 

-- 
-Michael Gillen
Re: Get message contents as plain text
#3000
Author: Peter Evans
Date: Sat, 10 Dec 2005 00:04
23 lines
1943 bytes
Pleased to hear that you are, Michael; but when one is advised the facility 
needed is only in Indy 10, then 9 won't do.

It would seem there are a number of potential users for Indy 10 with BCB 
just waiting for a smooth installation method.  May be you know of one 
(method)?  If so let us know, we'd be really grateful!

Best regards,

Peter Evans.


"Michael Gillen" <> wrote in message 
news:4396f903$1@newsgroups.borland.com...
> Remy Lebeau (TeamB) wrote:
>
>> That's not to say that there aren't a lot of BCB Indy users,
>> because there are.  Just not with Indy 10 (yet).
>
> Many of us are getting along just fine with Indy 9 too.
>
> -- 
> -Michael Gillen 
Re: Get message contents as plain text
#3002
Author: Michael Gillen
Date: Sat, 10 Dec 2005 18:08
13 lines
1567 bytes
Peter Evans wrote:

> It would seem there are a number of potential users for Indy 10 with BCB just waiting for a
> smooth installation method.  May be you know of one (method)?  If so let us know, we'd be really
> grateful!

I didn't mean to imply that you didn't need Indy 10, I was just saying that there may be allot if
BCB indy users in the weeds that are silent and for whom Indy 9 is sufficient at this time.

I, unfortunately, do not know of an Indy 10 installation method into BCB6.

-- 
-Michael Gillen
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads