All posts in the SSMTP category

Setup sSMTP configuration , Sending email without smtp service

Published December 3, 2013 by Siva

Follow the below steps on terminal…

# yum -y install ssmtp

If you have Sendmail installed, you need to run the following command below to change your default Mail Transfer Agent (MTA): –

# alternatives –config mta

There are 2 programs which provide ‘mta’.

Selection Command
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.ssmtp

Enter to keep the current selection[+], or type selection number: 2

You can verify the sendmail binaries by running the command below: –

# sendmail -V
sSMTP 2.61 (Not sendmail at all)

Now, sSMTP is installed and we will configure the mail server info to relay outgoing email. We going to create new configuration files as below: –

# mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.orig
# touch /etc/ssmtp/ssmtp.conf
# mv /etc/ssmtp/revaliases /etc/ssmtp/revaliases.orig
# touch /etc/ssmtp/revaliases

Next, we will configure sSMTP to forward email to any shared hosting server either running CPanel or DirectAdmin.

Include the following below in /etc/ssmtp/ssmtp.conf file: –


Include the following below in /etc/ssmtp/revaliases file: –

If you an option to forward email to Gmail server, you can configure using steps below.

Replace previous configuration to below in /etc/ssmtp/ssmtp.conf file: –


Replace previous configuration to below in /etc/ssmtp/revaliases file: –

Next, you can start sending email using your preferred email server using command below: –

# echo “Testing outgoing email” | mutt -s “Testing”

Finally, with all the configuration above I hope you are able to use and enjoy your sSMTP to send an email.

Thank you.