Created
May 16, 2013 22:52
-
-
Save hugo-dc/5595728 to your computer and use it in GitHub Desktop.
Send SMTP email
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
import smtplib | |
SERVER = 'server.com' | |
FROM = '[email protected]' | |
TO = ['test.server.com'] | |
SUBJECT = 'New Subject' | |
TEXT = 'This is the text' | |
message = """From: %s\r\nTo: %s\r\nSubject: %s\r\n\ | |
%s | |
""" % (FROM, ", ".join(TO), SUBJECT, TEXT) | |
server = smtplib.SMTP(SERVER) | |
server.sendmail(FROM, TO, message) | |
server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment