Email setup using SSMTP.

SMTP (Simple Mail Transfer Protocol) or SMTP (Secure Simple Mail Transfer Protocol) is a program used to deliver emails from a local computer to a configured mailhost (mailhub — Here Gmail will be used.). It is sometimes paired with other libraries e.g Mailutils, Mutt, etc.

Installing Packages.

For SSMTP

# apt-get install ssmtp

For Mailtulis

# apt-get install mailutils

For Mutt:

# apt-get install mutt

Confirm that all packages have been correctly installed

edit the SSMTP configuration file.

# nano /etc/ssmtp/ssmtp.conf

edit the contents of your ssmtp.conf file

This image has an empty alt attribute; its file name is ssmtp-1.png

Outgoing mail server (SMTP server) or mailhub=smtp.gmail.com:587
[email protected]
AuthUser=your Gmail address([email protected])
AuthPass=your generate gmail app password UseTLS=YES
UseSTARTTLS=YES FromLineOverride=NO

Now you are all set to send emails from the command line. Use the command below to test it out.

echo "Testingclear!" | mail -s "Test Email" y[email protected]

The email setup is done and working properly!!!!

Leave a Comment

Your email address will not be published. Required fields are marked *