ssh into your pi and type the following commands at the command line:

ssh pi@192.168.X.X
source ~/oprint/bin/activate
pip install yagmail
python

I had to do pip install yagmail. The plugin seems to indicate that it brings along yagmail.

This will give you the python prompt that the Email Notifier is talking about “>>>”.  Type the following into python:

import yagmail
yagmail.register('mygamiladdress@gmail.com', 'MySecret')

Got an error :

RuntimeError: No recommended backend was available. Install the keyrings.alt package if you want to use the non-recommended backends. See README.rst for details.

Installed keyrings ; see others getting the same issue

source ~/oprint/bin/activate
pip install keyrings.alt
pip install yagmail
python
import yagmail
yagmail.register('mygamiladdress@gmail.com', 'MySecret')

To test whether everything is right

yagmail.SMTP('mygamiladdress@gmail.com').send('toaddress@gmail.com', 'subject', 'This is the body')

Note: If you have a single quote in your password, use double quotes to surround it instead of the single quotes I used. If you have both single quotes and double quotes in your password, then uh it’ll be more complicated.

Then press Ctrl-D to exit python.

Advertisements