Guest User

Untitled

a guest
Jul 17th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. # Gmail TLS SMTP object
  2. smtpObj = smtplib.SMTP('smtp.gmail.com', 587)
  3. print(type(smtpObj))
  4. # if = <class 'smtplib.SMTP'> SUCCESS!
  5.  
  6. # Say ehlo
  7. print(smtpObj.ehlo())
  8. # if item [0] is int 250 SUCCESS!
  9.  
  10. # Enable encryption for connection
  11. print(smtpObj.starttls())
  12. # if item [0] is int 220 server is ready (SUCCESS)
  13.  
  14. print(smtpObj.login('cinematimespy@gmail.com', input('cinematimes.py password: ')))
  15. # if item [0] is int 235, SUCCESS!
  16.  
  17. # Send the email
  18. smtpObj.send_message(msg)
  19.  
  20. # Disconnect from SMTP server
  21. smtpObj.quit()
Add Comment
Please, Sign In to add comment