 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jacques Guest
|
Posted: Thu Dec 08, 2005 10:29 pm Post subject: Rendering HTML Email D7/indy 10.0.52 |
|
|
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
|
Posted: Thu Dec 08, 2005 10:49 pm Post subject: Re: Rendering HTML Email D7/indy 10.0.52 |
|
|
| 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
|
Posted: Thu Dec 08, 2005 10:54 pm Post subject: Re: Rendering HTML Email D7/indy 10.0.52 |
|
|
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
|
Posted: Fri Dec 09, 2005 12:42 am Post subject: Re: Rendering HTML Email D7/indy 10.0.52 |
|
|
"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 |
|
 |
|
|
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
|
|