Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Gmail TLS SMTP object
- smtpObj = smtplib.SMTP('smtp.gmail.com', 587)
- print(type(smtpObj))
- # if = <class 'smtplib.SMTP'> SUCCESS!
- # Say ehlo
- print(smtpObj.ehlo())
- # if item [0] is int 250 SUCCESS!
- # Enable encryption for connection
- print(smtpObj.starttls())
- # if item [0] is int 220 server is ready (SUCCESS)
- print(smtpObj.login('cinematimespy@gmail.com', input('cinematimes.py password: ')))
- # if item [0] is int 235, SUCCESS!
- # Send the email
- smtpObj.send_message(msg)
- # Disconnect from SMTP server
- smtpObj.quit()
Add Comment
Please, Sign In to add comment