Close

Sending status mails

A project log for Heimdall - dumb remote home

It's not smart. It's a raspberry pi I can ssh into. With a fancy mac inspired case.

davedarkodavedarko 12/10/2015 at 12:050 Comments

http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/

sudo apt-get install ssmtp

sudo nano /etc/ssmtp/ssmtp.conf

root=myemailaddress@gmail.com
mailhub=smtp.gmail.com:587
AuthUser=mygmailusername
AuthPass=mypassword
UseSTARTTLS=YES

If you use your google account then you will have to add an app password instead of your user password.

ssmtp myemailaddress@gmail.com < msg.txt

msg.txt is a simple text using the proper formatting for sSMTP:
To: myemailaddress@gmail.com
From: myemailaddress@gmail.com
Subject: alert

The server is down!

Ctrl+D

or
 
printf "To: myemailaddress@gmail.com\nFrom: myemailaddress@gmail.com\nSubject: New IP address\n\n\nMessage\n" | ssmtp myemailaddress@gmail.com

Discussions