import sys, smtplib, socketserver = "server.com"fromaddr = "frolm@from.com"toaddrs = "to@to.com"message = """To: %sFrom: %sSubject: Test MessageHello,This is a test message.""" % (', '.join(toaddrs), fromaddr)try: s = smtplib.SMTP(server) s.set_debuglevel(1) s.sendmail(fromaddr, toaddrs, message)except (socket.gaierror, socket.error, socket.herror, smtplib.SMTPException), e: print e sys.exit(1)else: print "sent"
Name (required)
email (will not be published) (required)
Website