Skip to content

Instantly share code, notes, and snippets.

@OtavioBraga
Created October 9, 2017 20:15
Show Gist options
  • Save OtavioBraga/ef2b0d40478d8a22e3dd88ea4b8e7c48 to your computer and use it in GitHub Desktop.
Save OtavioBraga/ef2b0d40478d8a22e3dd88ea4b8e7c48 to your computer and use it in GitHub Desktop.
import smtplib
smtp_server = smtplib.SMTP('smtp.gmail.com', 587)
smtp_server.ehlo()
smtp_server.starttls()
smtp_server.login('[email protected]', '<App Password>')
smtp_server.sendmail('[email protected]', '[email protected]', 'Subject: Happy Australia Day!\nHi Everyone! Happy Australia Day! Cheers, Julian')
smtp_server.quit()
print('Email sent successfully')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment