import sys, smtplib
server = "server.com"
fromaddr = "from@from.com"
toaddrs = "to@to.com"
message = """To: %s
From: %s
Subject: Test Message
Hello,
This is a test message.
""" % (', '.join(toaddrs), fromaddr)
s = smtplib.SMTP(server)
s.sendmail(fromaddr, toaddrs, message)
print "sent"