Skip to content

Instantly share code, notes, and snippets.

@chrisji
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisji/a0567f5751292324ab7a to your computer and use it in GitHub Desktop.
Save chrisji/a0567f5751292324ab7a to your computer and use it in GitHub Desktop.
Send an email, using gmail.
import smtplib
message = 'message'
recipient = 'to_user@gmail.com'
sender = 'from_user@gmail.com'
password = 'password'
session = smtplib.SMTP_SSL('smtp.gmail.com:465')
session.login(sender, password)
session.sendmail(sender, recipient, message)
session.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment