Using TIdEventLog with Indy 10.5.7 not sure what change is needed

Giganews Newsgroups
Subject: Using TIdEventLog with Indy 10.5.7 not sure what change is needed
Posted by:  Frank Bishop (francis12…@fairpoint.net)
Date: Thu, 29 Oct 2009

I have an application which I'm using to investigate TIdEventLog

I drop a TIdMessage TIdSMTP and TIdEventLog on a form

and wire them up with the following code (eventually I will create these
objects at run time so I like to avoid making design time settings)

  IdSMTP1.Host := 'xxx';
  IdSMTP1.Port := 25;
  IdSMTP1.Username := 'xxx';
  IdSMTP1.Password := 'xxx';
  IdMessage1.From.Text := 'xxx';
  IdMessage1.Sender.Text := 'xxx';
  IdMessage1.Recipients.EMailAddresses := 'xxx';

  IdMessage1.Subject := 'Testing TIdLog V1.0';
  IdMessage1.Body.Add('Testing TIdLog');

  { wire up and turn on the event log }

  IdSMTP1.Intercept := IdLogEvent1;
  IdLogEvent1.Active := true;

{ add these events to capture the traffic in the log }

procedure TForm1.IdLogEvent1Received(ASender: TComponent; const AText,
AData: string);
begin
memo1.lines.add('OnReceived='+ AData);
end;

procedure TForm1.IdLogEvent1Sent(ASender: TComponent; const AText,
AData: string);
begin
memo1.lines.add('OnSent='+ AData);
end;

procedure TForm1.IdLogEvent1Status(ASender: TComponent; const AText:
string);
begin
memo1.lines.add('OnStatus='+ AText);
end;

then I send the message

The messages get delivered and the log captures the traffic in version
10.2.3

now moving to 10.5.7 I can no longer use

  IdSMTP1.Intercept := IdLogEvent1;

when attempting to use it at design time it says property intercept does
not exist

when attempting to use it at run time it says undeclared identifier
Intercept

Also I other point I'm using
IdLogEvent1Received
IdLogEvent1Sent
and IdLogEvent1Status

instead of
OnConnect
OnDisConnect
OnReceive
and OnSend

On Receive and OnSend are just another flavor of Received and Sent using
strings instead of a TIdBytes Buffer ?

What are the primary reasons for these differences? or Can You give me a
  little more info to help me understand these?

Thanks,
    I searched threw the atozed newsgroups but didnt find anything helpful
on this issue.

Replies