No connection

Giganews Newsgroups
Subject: No connection
Posted by:  Captain Kirk (abu…@127.0.0.1)
Date: Tue, 25 Nov 2003

I'm trying to read through a list of friends in order to send them the same
email (lazy so and so, I am!)

I'm having problems connecting. What am I doing wrong (or right for that
matter)?

procedure TForm1.Button1Click(Sender: TObject);
var Count: Integer;
begin
//Login
IdSMTP1.Connect(Count);
if Count = -1 then
  begin
  ShowMessage('Connection Timeout.');
  exit;
  end;
for Count := 0 to CheckListBox1.Items.Count-1 do
  begin
  CheckListBox1.Selected[Count] := True;
  IdMessage1.Body := Memo1.Lines;
  IdMessage1.Sender.Address := LabeledEdit2.Text;
  IdMessage1.Recipients.Add.Address := CheckListBox1.Items.Strings[Count];
  IdMessage1.MsgId := 'SageWorld Mass Mailer v 1';
  // send
  IdSMTP1.Send(IdMessage1);
  end;
//Logout
IdSMTP1.Disconnect;
end;

Replies