Created
November 4, 2011 19:01
-
-
Save batok/1340186 to your computer and use it in GitHub Desktop.
A test of ses "AWS" service from python using boot
This file contains hidden or 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
""" | |
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