How to Configure SMTP Sendmail in UNIX

Before starting to configure SMTP Sendmail in UNIX, firstly, the connection from UNIX server has to be opened to SMTP mail server (in our trial port being used is 25). Once its opened, kindly continue with following steps:

1# Backup the hosts (/etc/inet/hosts) file

2# Edit hosts file by adding new entry (replace 10.10.10.10 with your SMTP mail server, and smtpserver.company.com with your SMTP mail server’s FQDN)

10.10.10.10 mailhost smtpserver.company.com

3# Edit following lines in sendmail.cf file (replace smtpserver.company.com with your SMTP mail server’s FQDN)

# "Smart" relay host (may be null)
DSsmtpserver.company.com

4# Restart smtp:sendmail service

svcadm restart smtp:sendmail

Now sending mail can be tested from UNIX server, below simple test is an example

echo "This is body of my mail. Regards" | mailx -s "Subject of My Testing Mail over SMTP" recipient@mymail.com