Skip to content

Instantly share code, notes, and snippets.

@batok
Created November 4, 2011 19:01
Show Gist options
  • Save batok/1340186 to your computer and use it in GitHub Desktop.
Save batok/1340186 to your computer and use it in GitHub Desktop.
A test of ses "AWS" service from python using boot
"""
do ...
pip install boto, turbomail
echo "just a test" > README.txt
... first
"""
import sys
from boto import connect_ses
FROM = "[email protected]"
TO = "[email protected]"
SUBJECT = "test"
CONTENTS = "contents"
ATTACHMENT= "README.txt"
c = connect_ses()
from turbomail.message import Message
m = Message( FROM, TO, SUBJECT)
with open(ATTACHMENT, "rb") as fp:
m.attach( fp, ATTACHMENT)
m.plain = CONTENTS
raw_email = str(m)
print raw_email
c.send_raw_email( FROM, raw_email, TO)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment