Last active
August 29, 2015 14:13
-
-
Save lazybios/f8284738e5976e5a89de to your computer and use it in GitHub Desktop.
'''send mail by smtplib module'''
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
import smtplib | |
from email.mime.text import MIMEText | |
'''send mail by smtplib module''' | |
# me == my email address | |
# you == recipient's email address | |
me = "[email protected]" | |
you = "[email protected],[email protected]" | |
content = 'msg detail' | |
server = smtplib.SMTP('server_address',25) | |
server.starttls() | |
server.login(username,passwd) | |
#msg = MIMEText(content,'html') | |
msg = MIMEText(content,'plain') | |
msg['Subject'] = 'subject' | |
msg['From'] = me | |
msg['To'] = you | |
server.sendmail(me, you.split(','), msg.as_string()) | |
server.quit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment