HomeMy SetupResourcesNewsProjects/CodeFAQsContact
Raspberry Pi Projects > FAQs and HowTos > SMTP Mail Setup

SMTP Mail Setup

Many times you want to have the ability to send email from processes on your Raspberry Pi to email addresses out on the network. Adding email to your Raspberry Pi is pretty simple. You can use the following three packages for some simple mail capabilities.

It is assumed that you have networking working already...

Loading the packages

sudo apt-get install ssmtp
sudo apt-get install mailutils
sudo apt-get install mpack

Setting up the defaults for SSMTP

sudo nano /etc/ssmtp/ssmtp.conf
Now edit the fields:
AuthUser=youruserid@gmail.com
AuthPass=userpass
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

Using Email Now

echo "sample text" | mail -s "Subject" username@domain.tld

Sending Attachments

mpack -s "test" /home/pi/test/somefile.ext username@domain.tld


Copyright © 2015, all rights reserved. Manage
Page Creation by TNET using Boltwire v3.4.16 Hosting by TNET - Views #3105 - Ulterius Server
IP: 46.208.197.157 [157.197.208.46.dyn.plus.net] - Wed Aug 5 07:37:40 2015