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 add/edit the fields:

Using Email

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

Sending Attachments

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