Re: How to handle different Content-Type's

Giganews Newsgroups
Subject: Re: How to handle different Content-Type's
Posted by:  Remy Lebeau (TeamB) (
Date: Mon, 19 Jul 2004

"Etienne van Tonder" <e…> wrote in message

> Currently I am using the following code but it assumes that if
> the content-type does not include multipart it's either text or html.

That is not a correct assumption to make.

> This is not the case as I've discovered as the Content-Type
> can contain many types including "video/x-ms-wmv"

Such types would be interpreted as attachments, not text.

>        if

When "multipart/" is not present then check for "text/" instead.  The
message may contain just plain text or HTML without any other parts in the

>        else
>        {
>            LogEntry(fpLog, "GetBody: not a multipart message\
>            // Get normal text/plain body
>            textbody = msg->Body->Text;

You should be checking the ContentType again to make sure it really contains
textual content before assuming that it does.




In response to

How to handle different Content-Type's posted by Etienne van Tonder on Mon, 19 Jul 2004