BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rendering HTML Email D7/indy 10.0.52

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Jacques
Guest





PostPosted: Thu Dec 08, 2005 10:29 pm    Post subject: Rendering HTML Email D7/indy 10.0.52 Reply with quote



if someone can either provide sample code or point me in the right direction
to solve this problem i will be very greatful, because i've been fighting
with it for almost two days.

Basically, i've created a mail client that recieves plain email messages ok,
but when someone sends a html email it gets displayed with html tags etc, i
use a memo to display the message body. I tried using the browser component
by storing the message body in a string and then writing that string into a
html file and then navigating the browser to this file, but that did not do
the trick either. One of two things happen when i do this: Either it does
not show the message at all, or if it does, then it does not render the html
at all. wierd.

So i'm kind of running out of options.

Also, how do we check if a message is html?
thanks


Back to top
Don
Guest





PostPosted: Thu Dec 08, 2005 10:49 pm    Post subject: Re: Rendering HTML Email D7/indy 10.0.52 Reply with quote



Quote:
Basically, i've created a mail client that recieves plain email messages
ok, but when someone sends a html email it gets displayed with html tags
etc, i use a memo to display the message body. I tried using the browser
component by storing the message body in a string and then writing that
string into a html file and then navigating the browser to this file, but
that did not do the trick either. One of two things happen when i do this:
Either it does not show the message at all, or if it does, then it does
not render the html at all. wierd.

Also, how do we check if a message is html?

Ok. Let's tackle this in reverse order.

TIdMessage has a ContentType property that tells you what it contains. If
it starts with "text", then the entire message is stored in the Body for the
message. If it starts with "multipart", then you have to look at the
MessageParts collection to get the content for the message.

The collection entries are are of type TIdMessagePart (or a descendant). It
too has a ContentType property that indicates what it contains. All the
possible values are listed in the docs for the TIdMessage.ContentType
property.

"text/plain" is well... plain ASCII text (so use a TMemo).
"text/html" is HTML (so use TWebBrowser or another HTML viewer).



Back to top
Klaus Dewald
Guest





PostPosted: Thu Dec 08, 2005 10:54 pm    Post subject: Re: Rendering HTML Email D7/indy 10.0.52 Reply with quote



Take a look at www.pbear.com. It seems to do the job you want.

Klaus Dewald

Jacques schrieb:
Quote:
if someone can either provide sample code or point me in the right direction
to solve this problem i will be very greatful, because i've been fighting
with it for almost two days.

Basically, i've created a mail client that recieves plain email messages ok,
but when someone sends a html email it gets displayed with html tags etc, i
use a memo to display the message body. I tried using the browser component
by storing the message body in a string and then writing that string into a
html file and then navigating the browser to this file, but that did not do
the trick either. One of two things happen when i do this: Either it does
not show the message at all, or if it does, then it does not render the html
at all. wierd.

So i'm kind of running out of options.

Also, how do we check if a message is html?
thanks



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Dec 09, 2005 12:42 am    Post subject: Re: Rendering HTML Email D7/indy 10.0.52 Reply with quote


"Don" <blacknapkin (AT) twistandfruge (DOT) com> wrote


Quote:
If it starts with "multipart", then you have to look at the
MessageParts collection to get the content for the message.

There are other content types that use the MessageParts collection as well,
such as messages with UUE or YEnc attachments.

Quote:
The collection entries are are of type TIdMessagePart (or a descendant).

TIdMessagePart should never be instantiated directly, only descendants.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.