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
Installing sSMTP
1. Open a terminal and connect with ssh or just type (for local installation)
1 |
sudo apt-get install ssmtp |
Configuring sSMTP
Once you’re done give …
1 |
sudo nano /etc/ssmtp/ssmtp.conf |
…and change only these fields inside ssmtp.conf
1 2 3 |
root=myemailaddress@gmail.com mailhub=smtp.gmail.com:587 hostname=yourmachineshostname |
and at the end of the file add these (one per line)
1 2 3 |
AuthUser=mygmailusername AuthPass=mypassword UseSTARTTLS=YES |
That’s it!
-
Free Bugs Funny T-Shirt16.00 € – 21.50 €
-
Being a Systems Administrator is like … T-Shirt16.00 € – 21.50 €
Sending emails from sSMTP
Type in terminal
1 |
ssmtp receipients_email@whatever.com |
and then type (notice lines and the blank line after subject)
1 2 3 4 5 |
To:receipients_email@whatever.com From:youremail@gmail.com Subject:The 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 …
1 |
ssmtp receipients_email@whatever.com < message.txt |
Tips:
- 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)
thnx, Specktator.
-
Engineers Get Shit Done Funny T-Shirt16.00 € – 21.50 €
-
Bot Wars: The Rise Of The Bots Funny T-Shirt16.00 € – 21.50 €
-
I Love Search Engines It’s Like The Brain I Don’t Have Funny T-Shirt16.00 € – 21.50 €
i didn’t send or recive any email using ur program!!!!!