#10321: Add support for sending binary DATA and Message objects to smtplib

This commit is contained in:
R. David Murray 2010-11-08 17:15:13 +00:00
parent a563392f92
commit 7dff9e08fb
7 changed files with 202 additions and 13 deletions

View file

@ -17,8 +17,7 @@ msg['Subject'] = 'The contents of %s' % textfile
msg['From'] = me
msg['To'] = you
# Send the message via our own SMTP server, but don't include the
# envelope header.
# Send the message via our own SMTP server.
s = smtplib.SMTP()
s.sendmail(me, [you], msg.as_string())
s.sendmail(msg)
s.quit()