Relay is denied by default.  If you're sending from some specific
machines, you can edit /etc/mail/access and add lines such as:

        Connect:         RELAY

replacing with the IP address of the sending machine.
Restart sendmail after editing the file:

        service sendmail restart

Sendmail will allow relay ONLY from those machines.  You can also enter
the domain names of the machines into /etc/mail/relay-domains, but
that's a bit less secure.

Yes , I tried that , right now my server is having ip address , so I typed in that and tried , still it does not work.Is the address supposed to be something else?