TIdMessage throws EAbstractError

Giganews Newsgroups
Subject: TIdMessage throws EAbstractError
Posted by:  Gerhard Hofmann (gerhard.hofma…@planat.de)
Date: Fri, 17 Jun 2005

Hi all,

I am trying to send an email using TIdMessage and it crashes with
EAbstractError.

--snip--
if SendLogFile = 1 then
  begin
    IdSmtp.Host:= MailServer;
    IdMessage.Subject:= subject + ' ' + DateToStr(Date);
    IdMessage.From.Address:= FromAddress;
    IdMessage.Recipients.EMailAddresses:= Recipients;
    IdAttachment:= TIdAttachment.Create(IdMessage.MessageParts);
    IdAttachment.FileName:= LogFileName;
    IdMessage.DoCreateAttachment(IdAttachment.Headers, idAttachment);
    IdSMTP.Connect;
    IdSMTP.Send(IdMessage);
    IdSMTP.Disconnect;
  end;
--snip--

Any ideas?

TIA
Gerhard

Replies