If you want your local installation of sendmail to forward all emails to certain, external smtp server, all you have to do is to enable and setup the smarthost feature on the sendmail.mc and sendmail.cf. To do that, open the sendmail.mc
[root@computron ~]# vi /etc/mail/sendmail.mc
Find the line that defines the smart host feature, uncomment, and point it to the external smtp server
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST', `[172.16.2.10]')dnl
dnl #
Please notice the bracket at the star and the end of the smtp server’s IP. Restart sendmail by issuing:
[root@computron ~]# service sendmail restart
check whether the change has been reflected on sendmail.cf
[root@computron ~]# vi /etc/mail/sendmail.cf
find the smart host entry, and make sure that the smart host Ip is pointed to the right server
# "Smart" relay host (may be null) DS[172.16.2.10]
If it’s there, then we’re done!