23) Setting up email on the Raspberry Pi

<-- Previous    Next –>

Setting up email on your Raspberry Pi is relatively easy using Gmail as an SMTP server.

If you have installed WordPress then you will need email to allow new users to register and add comments.

In the terminal:

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

Setting the configuration for ssmtp:

sudo nano /etc/ssmtp/ssmtp.conf

Now add the following to your file:

AuthUser=youruserid@gmail.com
AuthPass=userpass
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

AuthUser is the Gmail account that you are going to use.
AuthPass is the Gmail user password

To test the email do the following:

echo “body” | mail -s “Subject” toaddress@somwhere.com

where toaddress@somwhere.com is the to address that we want to send to and press return.

<-- Previous    Next –>