DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Sending Html Mail
Get the code for createhtmlmail(html, text, subject) <a href=http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/67083>here</a>.
import smtplib
html = open("newsletter.html").read()
text = open("newsletter.txt").read()
subject = "Today's Newsletter!"
message = createhtmlmail(html, text, subject)
server = smtplib.SMTP("localhost")
server.sendmail('my@dress.com', 'your@dress.com', message)
server.quit()





