eml2png
Paint the EML to a single PNG image.
Installing
You'll need wkhtmltopdf before you start working with eml2png, so install them first:
- Debian/Ubuntu:
sudo apt-get install wkhtmltopdf
- MacOSX
brew install wkhtmltopdf
- Windows and other options: check wkhtmltopdf homepage for binary installers or wiki page.
Install eml2png:
pip install eml2png
Usage
Simple example:
import eml2png
with open('message.png', 'wb') as f:
f.write(eml2png.to_png('message.eml'))
Export your wkhtmltopdf's install path if not /usr/bin/wkhtmltoimage
:
export WKHTMLTOIMAGE="/usr/local/bin/wkhtmltoimage"