Re: TIdMessage.SaveToStream and attachments

Giganews Newsgroups
Subject: Re: TIdMessage.SaveToStream and attachments
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Mon, 14 Aug 2006

"Aurélien Dellieux" <> wrote in message

> i am using Indy 10.0.52

That is an old version.  The current shapshot is 10.1.5.

> am having troubles using the TIdMessage.SaveToStream method.
> it seems to modify the attachments.

It is supposed to.  By design, SaveToStream() re-generates all of the
message data from scratch, essentially producing a new message.  If you
don't want that to happen, then you have to set the NoDecode property to
True when downloading, and the NoEncode property to True when saving.  This
way, you are saving the raw message data as-is with no Indy processing
performed on it.

> but if i do a message.savetostream before storing the attached files,
> then i get wrong attachments (particularly the signature logo, which is
> only linked to the html body).

Please elaborate.

> if i set NoEncode to True, then everything is ok, but the .eml file
> does not contain the encoded mime files anymore...

Did you set NoDecode to True before downloading the message?  If not, then
the raw message data is parsed during downloading, but the parsed data
cannot usually be used when NoEncode is True.



In response to

TIdMessage.SaveToStream and attachments posted by Aurélien_Dellieux on Mon, 14 Aug 2006