Basic SMTP transmission : SMTP : Network PYTHON TUTORIALS


PYTHON TUTORIALS » Network » SMTP »

 

Basic SMTP transmission


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"



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Network
» SMTP