Re: Sending a file attachent from a Blob using TIdAttachmentMemory

Giganews Newsgroups
Subject: Re: Sending a file attachent from a Blob using TIdAttachmentMemory
Posted by:  Remy Lebeau \(TeamB\) (no.spam@no.spam.com)
Date: Tue, 17 Jun 2008

"Grant Brown" <gra…@sitedoc.com.au> wrote in message
news:EEB1F4A94B57E340gra…@sitedoc.com.au...

> How do I send a email with a email attachment loaded from a TStream Obj.

One way would be to derive a custom class from TIdAttachment and have
> it use the original TStream directly.

> Is this the correct way to laod the file from the stream

That is one way to do it.  Just know that doing so will make a copy of the
TStream data in memory.  The larger the data, the more memory
TIdAttachmentMemory will use.

> Do I need to doing any thing to the stream prior to laoding
> the attachment.

No.

> As soon as the above returns am I then free to clean up and free the
> TStream

Yes.

> or do I need to maintain it until the email has beem sent.

Only if you derive a new class from TIdAttachment.

Gambit

Replies

None

In response to

Sending a file attachent from a Blob using TIdAttachmentMemory posted by Grant Brown on Wed, 11 Jun 2008