Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- port = 465 # For SSL
- smtp_server = "smtp.gmail.com"
- password = input("Type your password and press enter: ")
- message = """\
- Subject: Hi there
- This message is sent from Python."""
- context = ssl.create_default_context()
- with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
- server.login(sender_email, password)
- server.sendmail(sender_email, receiver_email, message)
Add Comment
Please, Sign In to add comment