Skip to content

Instantly share code, notes, and snippets.

@betterdatascience
Created October 30, 2020 20:45
Show Gist options
  • Save betterdatascience/c48ed1ce830dbf4777ff3da63430a434 to your computer and use it in GitHub Desktop.
Save betterdatascience/c48ed1ce830dbf4777ff3da63430a434 to your computer and use it in GitHub Desktop.
002_emails
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