SHARE
TWEET

Untitled

a guest Mar 13th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import smtplib
  2.  
  3. HOST = "mySMTP.server.com"
  4. SUBJECT = "Test email from Python"
  5. TO = "mike@someAddress.org"
  6. FROM = "python@mydomain.com"
  7. text = "Python 3.4 rules them all!"
  8.  
  9. BODY = "\r\n".join((
  10.     "From: %s" % FROM,
  11.     "To: %s" % TO,
  12.     "Subject: %s" % SUBJECT ,
  13.     "",
  14.     text
  15. ))
  16.  
  17. server = smtplib.SMTP(HOST)
  18. server.sendmail(FROM, [TO], BODY)
  19. server.quit()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top