Re: TIdAttachment in Indy10

Giganews Newsgroups
Subject: Re: TIdAttachment in Indy10
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Wed, 12 Aug 2009

"Arch" <archie.campbe…@ed.ac.uk> wrote in message
news:9729ACE7A18CE340archie.campbe…@ed.ac.uk...

> I thought it would go something like...

Close.  TIdAttachment is an abstract base class in Indy 10.  You have to use
a descendant class instead, such as TIdAttachmentFile, ie:

uses
    IdAttachment, IdAttachmentFile;

var
    attach: TIdAttachment;
begin
    ...
    attach := TIdAttachmentFile.Create(mailmsg.MessageParts, fname);
    ...
end;

--
Remy Lebeau (TeamB)

Replies

In response to

TIdAttachment in Indy10 posted by Arch on Wed, 12 Aug 2009