TidSMTP with MS Exchange 5.5

Giganews Newsgroups
Subject: TidSMTP with MS Exchange 5.5
Posted by:  Joe Reiss (medida…@ix.netcom.com)
Date: Sun, 14 Sep 2003

Using: Delphi 5 enterprise
Indy: 8.0.22
MS Exchange: 5.5

I'm trying to send email through an MS Exchange server.

I'm not succesfull, I get:

  The recipient name is not recognized

My Code:

*****************************************

try
    idMsg := TIdMessage.Create(nil);
      try
        with idMsg do
        begin
          From.Address          := sEmailFromAddress;
          Recipients.Add.Address := sEmailAddress;
          Subject                := sSubject;
          Body.Text              := slBody.Text;
        end;
        IdSMTP1.UserID := sEMailUserID;  \\ this something like xxxx\yyyy
        IdSMTP1.Host    := sEmailHost;      \\ ip address of exchange
server a.b.c.d ip address
        IdSMTP1.Connect;
        result := FUNC_PASS;
        try
          IdSMTP1.Send(idMsg);
        finally
          IdSMTP1.Disconnect;
        end;
      finally
        idMsg.Free;
      end;
  except
    on e:exception do
      begin
        alAppLog.bWriteToErrorLog (UNIT_NAME + '.iSendEmail ', e.message);
        result := FUNC_FAIL;
      end;

*********************************************

Is that I'm logging in to exchange server wrong; wrong userid, password ???
I'm using authentication := atNone
I'm told by the admin that SMTP is enabled and that for sending purposes
there is no authentication needed.

Any help appreciated.

Thanks,
Joe

Replies