Sending message fails depending on body length

Giganews Newsgroups
Subject: Sending message fails depending on body length
Posted by:  Craig Peterson (cra…@scootersoftware.com)
Date: Mon, 15 Jun 2009

I have the code below that's trying to send an email.  For our SMTP
server it fails with a read timeout, but if I remove one lines of the
body it succeeds.  For another SMTP server I tried outside our
organization removing the line didn't work, but adding extra junk after
the last line did.  Am I doing anything obviously wrong?

I'm using Delphi 2009 with the latest revision of Indy's Tiberon branch.

Thanks,
Craig Peterson
Scooter Software

procedure SendMessage;
var
  IdSMTP: TIdSMTP;
  Msg: TIdMessage;
begin
  IdSMTP := TIdSMTP.Create;
  IdSMTP.Host := 'mail.scootersoftware.com';
  IdSMTP.ReadTimeout := 5*1000; // Longer doesn't help
  Msg := TIdMessage.Create;
  Msg.From.Name := 'Scooter Software';
  Msg.From.Address := 'suppo…@scootersoftware.com';
  Msg.Recipients.EMailAddresses := <email address>;
  Msg.Body.Text :=
    'The quick brown fox jumped over the lazy dog.'#$D#$A +
    'The quick brown fox jumped over the lazy dog.'#$D#$A +
    'The quick brown fox jumped over the lazy dog.'#$D#$A +
    'The quick brown fox jumped over the lazy dog.'#$D#$A +
    'The quick brown fox jumped over the lazy dog.'#$D#$A#$D#$A;
  IdSMTP.Connect;
  IdSMTP.Send(Msg);
  Msg.Free;
  IdSMTP.Free;
end;

Replies