Created
October 30, 2020 20:45
-
-
Save betterdatascience/c48ed1ce830dbf4777ff3da63430a434 to your computer and use it in GitHub Desktop.
002_emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msg = EmailMessage() | |
msg['Subject'] = 'This is my first Python email' | |
msg['From'] = EMAIL_ADDRESS | |
msg['To'] = EMAIL_ADDRESS | |
msg.set_content('And it actually works') | |
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp: | |
smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD) | |
smtp.send_message(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment