SMTPRelay demo: Exception because of blank Host

Giganews Newsgroups
Subject: SMTPRelay demo: Exception because of blank Host
Posted by:  mysticforces (paul.four…@malans.co.za)
Date: Wed, 4 Apr 2007

I'm running version 10.1.5

I'm looking at the SMTP relay demo program.  It raises an exception in the btnSendMailClick procedure as soon as it tries to connect.  The problem actually happens further up the inheritance tree in the TIdTCPClientCustom object.

<snip>
procedure TIdTCPClientCustom.Connect;
begin
  // Do not call Connected here, it will call CheckDisconnect
  EIdAlreadyConnected.IfTrue(Connected, RSAlreadyConnected);

  EIdHostRequired.IfTrue(Host='');
  EIdPortRequired.IfTrue(Port=0);
<snip>

As soon as it checks if it has a 'host' filled in it raises an exception which then stops the rest of the program.

Replies