Using TIdAttachment

Giganews Newsgroups
Subject: Using TIdAttachment
Posted by:  Tom Hahn (tha…
Date: Sat, 19 Jun 2010

Delphi 7, Indy 9

My understanding is that to attach a file to a message I would use

TIdAttachment.Create(Msg.MessageParts, FileName);

I see no way to "free" this and it always "remembers" the file name that
was included the first time it was used. How do I update the file name
and/or free and create another instance? Is there some way to clear it
at the message level?

In the demo programs I have seen, no one seems to do anything like this.

Any suggestions would be appreciated.