Sending mail error

Giganews Newsgroups
Subject: Sending mail error
Posted by:  John Nguyen (jnguy…@udri.com)
Date: Tue, 11 Jan 2005

Hi,

Everytime I try to send an email, I receive the message "5.7.1 Unable to
relay for a…@yahoo.com".
Could someone help me to figure out what is wrong with my code.  I am using
Indy 9.0.

  if (IdSMTP->Connected())
    IdSMTP->Disconnect();
  IdSMTP->Host = "xxx.HCI.pvt";
  IdSMTP->Port = 25;
  IdSMTP->Connect();
  IdSMTP->Clear();

  IdMessage->Subject = "email testing";
  IdMessage->Body->Add("Please discard this");
  IdMessage->From->Address = "operations";
  IdMessage->From->Name = "Operations";

  IdMessage->Recipients->Add();
  IdMessage->Recipients->Items[0]->Address = "a…@yahoo.com";
  IdMessage->Recipients->Items[0]->Name = "abc";

  IdSMTP->Send(IdMessage);
  IdSMTP->Disconnect();

Thanks

John

Replies