Before getting into the history. I ended up using Python3 and the smtplib library. Quick, simple, and reliable.
I’m doing some volunteer work that requires sending group mail with customization. Currently they do this manually using Outlook which seems like a horrible waste of manpower so I thought why not harness a spare Raspberry PI to send mail?
Wow was that harder than I thought. I could send mail to some addresses but not others. The biggest problem was reverse DNS authentication. It turns out that the only reliable way to send email that I found not getting black-listed was to route it through GMail.
So then I looked into GMail via Raspberry PI solutions and I found, as usual, many on the web. Most of these required substantial .INI file modifications and tweaking to alias files and installing guaranteed-latest versions and … you know the drill.
Then it was hours analyzing log files and trying to find out why things didn’t work.
It turns out… there’s a simple way to do this. I like Python on my Raspberry Pi (and other Linux distros). I did this on the latest Jessie-Lite distro.
I use Python3 (not 2.7) because the class support is awesome. Python 2.7 is kind of a toy. Python 3 is a professional product.
Steps to Success
- Install Python3
2. Create a GMail account. I built a special account just for bulk mailing because, why not. Also you care a lot less about security.
3. Here’s some sample code that works the first time. You can type this into the interpreter and watch it work line by line or just create a function using similar code. Note that smtplib comes by default.