Edit

Send email using ssmtp

Note:
OS: Ubuntu

$ apt update && apt install ssmtp
$ systemctl stop sendmail/postfix
$ service sendmail/postfix stop
$ systemctl disable sendmail/postfix
$ alternatives --config mta
$ cat /etc/ssmtp/ssmtp.conf
AuthUser=email@gmail.com
AuthPass=userpassword
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
$ ssmtp recipient_email@example.com
To: recipient_email@example.com
From: myemailaddress@gmail.com
Subject: test email

Hello World!
Ctrl+D
$ whereis mail
$ cd /usr/sbin && ls -l | grep sendmail
$ echo "Testing" | mail -s "Test Email" email@gmail.com

%23%23%23%60Send%20email%20using%20ssmtp%60%0A%0A%3E**Note%3A**%0A*OS%3A%20Ubuntu*%0A%60%60%60sh%0A%24%20apt%20update%20%26%26%20apt%20install%20ssmtp%0A%24%20systemctl%20stop%20sendmail/postfix%0A%24%20service%20sendmail/postfix%20stop%0A%24%20systemctl%20disable%20sendmail/postfix%0A%24%20alternatives%20--config%20mta%0A%24%20cat%20/etc/ssmtp/ssmtp.conf%0A%20%20AuthUser%3Demail@gmail.com%0A%20%20AuthPass%3Duserpassword%0A%20%20FromLineOverride%3DYES%0A%20%20mailhub%3Dsmtp.gmail.com%3A587%0A%20%20UseSTARTTLS%3DYES%0A%24%20ssmtp%20recipient_email@example.com%0A%20%20To%3A%20recipient_email@example.com%0A%20%20From%3A%20myemailaddress@gmail.com%0A%20%20Subject%3A%20test%20email%0A%0A%20%20Hello%20World%21%0A%20%20Ctrl+D%0A%24%20whereis%20mail%0A%24%20cd%20/usr/sbin%20%26%26%20ls%20-l%20%7C%20grep%20sendmail%0A%24%20echo%20%22Testing%22%20%7C%20mail%20-s%20%22Test%20Email%22%20email@gmail.com%20%0A%60%60%60%0A%0A%0A@%28Postach.io%29%5Bssmtp%2Cmail%2Csmtp%2Cgmail%2Cpublished%5D