Re: TIdMessagePart: how can I get the Content-ID

Giganews Newsgroups
Subject: Re: TIdMessagePart: how can I get the Content-ID
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Thu, 16 Oct 2003

"Michael Rettkowitz" <Te…@Geotrada.de> wrote in message
news:3D501EEFC882E240Te…@Geotrada.de...

> I'm using Indy 9. Does anyone know, how to get the Content-ID
> (CID) of a TIdMessagePart. I think, there is no string var available
> and also it isn't to find in the Header and ExtraHeaders lists of the
> TIdMessagePart.

If a Content-ID is specified in a received message, it is will indeed be
listed in the Headers property along with all other headers, it is not
stripped out or ignored.  There is no helper propery for Content-ID, so
you'll just have to read it from the Headers directly, ie:

    CID := Msg.Headers.Values['Content-ID'];

As for sending an outgoing message, again there is not specific property for
Content-ID, so you would need to place the value into the ExtraHeaders
property manually:

    Msg.ExtraHeaders.Values['Content-ID'] := CID;

Gambit

Replies

In response to

TIdMessagePart: how can I get the Content-ID posted by Michael Rettkowitz on Thu, 16 Oct 2003