SMTP failing

Giganews Newsgroups
Subject: SMTP failing
Posted by:  Ian Emery (ianeme…@hotmail.com)
Date: Fri, 21 May 2004

Can anyone give me an example on sending an smtp mail to lycos. It is
causing an excption saying helo command rejected: need a fully-qualified
hostname

here is the code (the host I have resolved the mx records for lycos.co.uk
and this is one of those that came up)...

what do I need to add to the code???

var
  mail : Tidmessage;
  address, body : String;
begin
  if MailConnection.Connected then MailConnection.Disconnect;
  MailConnection.Port := 25;
  mailCOnnection.Host :='mx2.mail.spray.net';
  MailConnection.Connect;
//  Address := SelectQ.FieldByName('Fuseremail').AsString;
  Address := '…@lycos.co.uk';
  Body := ' message body here ';
  Mail := tidmessage.Create(nil);
  Mail.Recipients.EMailAddresses := Address;
  Mail.Sender.Address := '…@y.com';
  Mail.Sender.Name := 'ian';
  Mail.Sender.Text := '…@y.com';
  Mail.Sender.DisplayName := '…@y.com';
  Mail.ReplyTo.EMailAddresses := '…@y.com';
  Mail.Subject := 'Subject here';
  Mail.body.Add(body);    //.Assign(body);
  MailConnection.Send(mail);

  Mail.Free;

  MailConnection.Disconnect;
end;

Replies