Skip to content

Instantly share code, notes, and snippets.

@clemesha
Created November 30, 2009 09:18
Show Gist options
  • Save clemesha/245351 to your computer and use it in GitHub Desktop.
Save clemesha/245351 to your computer and use it in GitHub Desktop.
import smtplib
s = smtplib.SMTP("smtp.gmail.com")
s.ehlo()
s.starttls()
s.ehlo()
s.login("username", "password")
msg = "From: username@gmail.com\r\nTo: other.user@gmail.com\r\nSubject: Testing 1 2 3\r\n\r\n"
msg += "This is a test, only a test."
s.sendmail("username@gmail.com", "other.user@gmail.com", msg)
s.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment