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 with your SMTP mail server, and with your SMTP mail server’s FQDN) mailhost

3# Edit following lines in file (replace with your SMTP mail server’s FQDN)

# "Smart" relay host (may be null)

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"