SSMTP is a simple MTA(Message Transfer Agent) to send off mail from a Linux system to a mailhub. For a mailhub will use a Gmail account. SSMTP can send emails by itself or you can install mutt (it’s another simple MTA).
Always it’s a good idea to configure your server to notify you with some cronjobs for errors instead of not doing it at all and just checking logs by yourself :P
1. Open a terminal and connect with ssh or just type (for local installation)
sudo apt-get install ssmtp
Once you’re done give …
sudo nano /etc/ssmtp/ssmtp.conf
…and change only these fields inside ssmtp.conf
and at the end of the file add these (one per line)
Sending emails from sSMTP
Type in terminal
and then type (notice lines and the blank line after subject)
Hello this is my first ssmtp email!
then press Ctrl D and sSMTP will send your email before closing.
Send predefined emails from .txt files
Write your message to a txt file by keeping the standard format from above and type …
ssmtp email@example.com < message.txt
- Overall i suggest to install sSMTP and send your emails with mutt
- schedule some cronjobs
- install and configure fail2ban (if you want to add some basic security to your server)