Do you want to email a picture from your phone to your digital picture frame? And allow friends & family to do the same?
In the past, my recommendation, based on Gmail, was described here.
However, back in 2022 I received an email from blog reader Daniel telling me that Google would stop allowing email access by “less secure apps” end of May 2022. Unfortunately, a Raspberry Pi Python script apparently qualifies as a “less secure app” and consequently, my proposed solution would not work any longer past this date.
But Daniel was kind enough to identify a solution that I tested at the time and it worked brilliantly. That is what this article describes, and it is still the route I would take.
Two things have changed since 2022, and both matter before you start. First, the installation command below no longer works as written — Raspberry Pi OS has blocked system-wide pip install since Bookworm. Second, Gmail is no longer the exception it was: an App Password on an account with 2-Step Verification works fine with IMAP today. Details on both are in place further down.
Sending photos to your frame
First, a bit of background.
Regularly adding images to the collection on your digital picture frame is a crucial ingredient to enjoying the experience every day a bit more.
I have described a solution to share your digital picture frame image folder with family & friends using Resilio Sync. But sometimes even this is too much hassle, and you want an even simpler solution.
This is why it is helpful to have alternative ways to add images that are both fully automated and require no maintenance.
One approach is to send one or several images via email. This can be a dedicated email account or your normal one. I would, however, recommend a dedicated email account.
The emails have to be marked with a secret subject line, and only emails with this “password” are scanned and processed. The photos will then be downloaded and added to your frame – without you having to do a thing.
Following this scan, all emails are deleted, except those that did not have the matching subject line.
The following instructions assume that you have read the article “How to set up your Raspberry Pi for your digital picture frame“.
The attachment-downloader package
Thanks to James Ridgway and his fantastic solution, we now have an alternative when the Gmail changes happen.
For this solution to work, most email accounts should be fine. I tested it with WEB.DE, a German email provider.
This article used to say “well, except for Gmail”. That is out of date: Gmail works with this today, you just need an App Password rather than your ordinary account password. Turn on 2-Step Verification on the Google account, then create an App Password under Google Account → Security → App passwords, and pass that sixteen-character string as --password. Please email me if you find other providers where it doesn’t work.
The advantage of James’ solution is that it’s even easier to install than my previous script. It’s all described on his Github page but since I know that some of you may be a bit overwhelmed by the GitHub style, I’ll break it down for you.
The following instructions assume that you are ssh connected to your Raspberry Pi from another computer through Terminal.
To install the attachment-downloader package type:
sudo apt install pipx
pipx install attachment-downloader
pipx ensurepath
This is the step that changed. The article used to say pip3 install attachment-downloader. On Bookworm and Trixie that stops immediately with error: externally-managed-environment — Raspberry Pi OS no longer lets pip install into the system Python. pipx installs the tool into its own environment and puts the command on your path, which is exactly what we want here: one command, callable from crontab.
After pipx ensurepath you need a new login shell (or a reboot) for the path change to take. pipx installs the command to ~/.local/bin/attachment-downloader, which is the same place the old pip3 --user install put it, so the paths further down are unchanged.
The old install printed a long log like the one below. I have kept it because it shows you what the tool pulls in, but the version numbers in it are from 2022 and the /home/pi paths assume the default pi account that Raspberry Pi OS no longer creates:
[...]
Installing collected packages: imbox, assertpy, iso8601, pytz, python-dateutil, iniconfig, py, typing-extensions, zipp, importlib-metadata, pluggy, tomli, pyparsing, packaging, attrs, pytest, platformdirs, toml, wrapt, lazy-object-proxy, typed-ast, astroid, pylint, MarkupSafe, jinja2, coverage, pytest-cov, attachment-downloader
The scripts py.test and pytest are installed in '/home/pi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts epylint, pylint, pyreverse and symilar are installed in '/home/pi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts coverage, coverage-3.7 and coverage3 are installed in '/home/pi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed MarkupSafe-2.1.1 assertpy-1.1 astroid-2.9.3 attachment-downloader-1.2.2 attrs-21.4.0 coverage-6.3.2 imbox-0.9.8 importlib-metadata-4.11.3 iniconfig-1.1.1 iso8601-1.0.2 jinja2-3.0.3 lazy-object-proxy-1.7.1 packaging-21.3 platformdirs-2.5.1 pluggy-1.0.0 py-1.11.0 pylint-2.12.2 pyparsing-3.0.7 pytest-7.0.1 pytest-cov-3.0.0 python-dateutil-2.8.2 pytz-2021.3 toml-0.10.2 tomli-2.0.1 typed-ast-1.5.2 typing-extensions-4.1.1 wrapt-1.13.3 zipp-3.7.0
pi@email-pi:~ $
Reboot.
Extracting the photos from your email
Now send one or two emails with photos attached to the email that you will be using for your picture frame. In the email subject line enter “picframe” (without the quotes).
Check that you have a directory on your Pi that is called “Pictures”. If it’s not there yet, create it.
The attachment-download package has several options but if you want a simple solution, here is what you need to know: The generic command for extracting photos from your emails is:
$HOME/.local/bin/attachment-downloader --host XXX --username XXX --password "XXX" --imap-folder Inbox --output /your-directory/ --delete --subject-regex=XXX >$HOME/email.log 2>&1
I’ll walk you through it.
What you need from your email provider is the IMAP Server. In my case, this is imap.web.de.
“Username” is your email, in my case, thedigitalpictureframe@web.de.
“Password” says it all. It is put in quotes.
Reader Ron pointed out that you cannot have an “!” in any part of the password, or likely anywhere else for that matter in the script.
“Output directory” is where the photos are stored on your Raspberry Pi. I use ~/Pictures/. I used to write that as /home/pi/Pictures/; Raspberry Pi OS stopped creating a default pi account, so $HOME or ~ is the spelling that is right on every frame. On a picframe3 frame, point it at whichever picture folder you named during the install.
“subject-regex” is the secret code word that tells your Raspberry Pi that this email is destined for your photo frame. In my example below it is “picframe“. I would use one word only, spaces might make it more complicated.
“>$HOME/email.log 2>&1” is for adding a small log file that is written in your home directory.
So here is my customized script (Thanks to reader Daniel) that I use based on the information above (note to hackers: my password is fake of course):
$HOME/.local/bin/attachment-downloader --host imap.web.de --username thedigitalpictureframe@web.de --password "Cg@KreBVö843AQQk4^S&xU*EP2f85&NP" --imap-folder Inbox --output $HOME/Pictures/ --delete --subject-regex=picframe >$HOME/email.log 2>&1
This command does the following:
It checks your email account if there are emails with a subject line that matches your code word “picframe“. If there are any attachments, they will be downloaded and stored in your /Pictures folder. Following the download, the email will be deleted.
Several images can be included in one email, and all are downloaded. Note that there is a size limit to emails, often 20MB.
Just tell your friends & family to send the photos with the highest resolution setting and to not resize them in the email program. That way, you will have the best photo quality in your digital picture frame.
Automatically check your email every hour
To call this script every hour, you must modify your crontab file.
In Terminal enter
crontab -e
and add the following line in the editor, of course replacing your user name, password, etc.:
0 * * * * $HOME/.local/bin/attachment-downloader --host imap.web.de --username thedigitalpictureframe@web.de --password "Cg@KreBVö843AQQk4^S&xU*EP2f85&NP" --imap-folder Inbox --output $HOME/Pictures/ --delete --subject-regex=picframe >$HOME/email.log 2>&1
Conclusion
A big “Thank You” again to Daniel, who pointed out the coming issues with Gmail and who also suggested an alternative solution! And, of course, James for his wonderful script!
One note for 2026: email remains the easiest way to let a grandparent add a photograph to your frame — nothing to install at their end. For everyone else, a picframe3 frame on a Pi 4 or Pi 5 sets up Syncthing and a Samba share during installation, which is less machinery than a crontab line with a password in it. See the 2026 build guide. Either way, picframe3 watches the picture folder, so an emailed photograph is on the wall within seconds of landing.
I have corrected the install command and the Gmail paragraph above from what current Raspberry Pi OS and Google do today, but I have not re-run the whole thing end to end on Trixie. If you hit a snag, tell me and I will fix it here.
Was this article helpful?
Thank you for your support and motivation.