TIdSMTPServer, TIdSMTP and TIdMessage = error!!!

Giganews Newsgroups
Subject: TIdSMTPServer, TIdSMTP and TIdMessage = error!!!
Posted by:  JJW Inform├ítica Ltda. - Roberto (rober…@jjwinformatica.com.br)
Date: Thu, 14 Jun 2007

I have created a:

TIdSMTPServer with ReceiveMode=rmMessageParsed and:

procedure TForm1.IdSMTPServer1CommandMAIL(const ASender: TIdCommand;
  var Accept: Boolean; EMailAddress: String);
begin
  Accept := Pos('@', EMailAddress) > 0;
end;

procedure TForm1.IdSMTPServer1CommandRCPT(const ASender: TIdCommand;
  var Accept, ToForward: Boolean; EMailAddress: String;
  var CustomError: String);
begin
  Accept := Pos('@', EMailAddress) > 0;
end;

Then I create the TIdMessage and use the code:

IdSMTPServer1.Active := True;
IdSMTP1.Host := 127.0.0.1;
IdSMTP1.Connect;
IdSMTP1.Send(IdMessage1); // this raise Connecton Close Gracefully
IdSMTP1.Disconnect;
IdSMTPServer1.Active := False;

Any idea?

Replies