You have new mail
Having the images stored on your Raspberry Pi is not really much use—ideally, you would want the images sent to you straightaway, as soon as they are captured, so that you can view them on your smartphone.
An easy, quick, and reliable way to do this is to simply have them e-mailed to you. Hence we're going to add an e-mailing functionality to our home security system so that image captures are attached to a message and sent to your e-mail address straightaway, which you can access from your smartphone. The images can then be removed from your Raspberry Pi to prevent the SD card space from being clogged up with these reasonably large files.
Setting up the e-mail sender client
Fortunately, there are some good packages available that will help us with this. Carry out the following steps to install the email packages we need:
Update the package installer with the following command:
$ sudo apt-get update
Install and set up the SMTP client with the following command:
$ sudo apt-get...