Sunday, June 7, 2015

How to set RaspberryPi Send Mail

It was long day of working with Pi and I want to setup a email server where if anything happen with Pi(ya! right...) , I will get an email. After few research I found nice and easy (Very easy, only took 2 hour!) solution.

Go to : /etc/ssmtp/ssmtp.conf 
Save and Exit...

root=me@gmail.com
mailhub=smtp.gmail.com:465
hostname=raspberrypi
FromLineOverride=YES
AuthUser=me@gmail.com
AuthPass=mypass
UseSTARTTLS=YES

Test email echo "Hello world email body" | mail -s "Test Subject" recipientname@domain.com

It should work :)

No comments:

Post a Comment