Advertisement
Guest User

Untitled

a guest
Jan 11th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import smtplib
  2.  
  3. HOST = 'mail.example.com'
  4. USER = 'me@example.com'
  5. PASS = '1234'
  6.  
  7. TO = 'friend@example.com'
  8.  
  9. server = smtplib.SMTP(HOST, port=25)
  10. server.set_debuglevel(1)
  11. server.login(USER, PASS)
  12.  
  13. message = "Yolo!"
  14.  
  15. try:
  16. server.sendmail(USER, TO, message)
  17. except:
  18. print "Error occured"
  19.  
  20. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement