Re: Please verify that this is the correct method to define a multipart/alternat

Giganews Newsgroups
Subject: Re: Please verify that this is the correct method to define a multipart/alternat
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Mon, 21 Mar 2005

"orlando" <seasidebru…@hotmail.com> wrote in message
news:6587A9CB1BC4E240seasidebru…@hotmail.com...

>    lMessage.ContentType := 'multipart/related;
> type="multipart/alternative"';

Indy already does that automatically if you do not specify a ContentType
yourself.

>    // define multi-part alternative block
>    lTextPart := TIdText.Create(lMessage.MessageParts);
>    lTextPart.ContentType := 'multipart/alternative';
>    // incrementing the default from -1 to 0 to define as part of the
inner
> boundary
>    lTextPart.ParentPart := 0;

That is not correct.  The ParentPart for the "multipart/alternative" block
must be -1 because it it the first item in the MessageParts and because it
begins on the top level of the message.  The ParentPart is an index into the
MessageParts.  If you set the Parent to 0 for the first item, then the block
is becoming its own Parent, which will cause the final message data to be
messed up.

>    lImagePart.Headers.Add('Content-ID: <amy_graphic_1.jpg>');

Use the ContentID property instead:

    lImagePart.ContentID := '<amy_graphic_1.jpg>';

Gambit

Replies

In response to

Please verify that this is the correct method to define a multipart/alternate sm posted by orlando on Mon, 21 Mar 2005