Created
February 4, 2016 22:59
-
-
Save ScottSturdivant/a0a9cdb2c7ca3ee6a30d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from marrow.mailer import Mailer, Message | |
mailer = Mailer({'transport.use': 'smtp', 'transport.host': 'localhost', 'manager.use': 'immediate'}) | |
msg = Message(author='scott.sturdivant@gmail.com', to='scott.sturdivant@gmail.com') | |
msg.subject = 'Test Image' | |
msg.rich = '<b>An image.</b>' | |
msg.plain = 'An image.' | |
msg.attach(name='test_img.jpg', data=open('/tmp/test_img.jpg', 'rb').read() | |
mailer.send(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment