After following the normal steps for configuring the mail client i wasn't able to send mail .
following were the steps taken for configuring the mail client.
Make sure you have following rpms installed.
# rpm -qa| grep sendmail
(Note:Most linux distributions comes with sendmail rpm but most of the time you need to install sendmail-cf rpm according to your distribution).
Modified below parameter from /etc/mail/sendmail.mc file.
dnl define(`SMART_HOST', `internalmail.XXX.com')dnl
Here you define the name of your internal mail server.
(Note : Make sure you can ping the mail server from client machine).
Now its time to compile the /etc/mail/sendmail.mc file to /etc/mail/sendmail.cf.
the command used is.
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
After compiling its time to send the mail.
mail -s "test" myemailid@XXX.com , relay=root@localhost
Mar 16 10:58:13 XXX sendmail: p2G5SCCf005220: from=
Mar 16 10:58:13 XXX sendmail: p2G5SCgA005219: to=XXX@XXX.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30073, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p2G5SCCf005220 Message accepted for delivery)
Mar 16 10:58:15 XXX sendmail: STARTTLS=client, relay=XXX.XXX.com., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Mar 16 10:58:16 XXX sendmail: p2G5SCCf005220: to=
Mar 16 10:58:17 XXX sendmail: p2G5SCCf005220: p2G5SHCf005222: DSN: User unknown
Mar 16 10:58:17 XXX sendmail: p2G5SHCf005222: to=
It was bit clear from the log that machine was sending the email to itself but not able to send it to internal mail server.
Later i checked that the machine wasn't registered in DNS.so it was not returning its ip address after i issue following command.
when i added the machine in dns it was successfully resolving the ip address.
HOSTNAME.XXX.com has address XX.XXX.XXX.XXX
So it was all due to DNS not having our server entry and nothing wrong with Configuration of mail.