Skip to content

Instantly share code, notes, and snippets.

@JoshAshby
Created March 16, 2013 05:01
Show Gist options
  • Save JoshAshby/5175068 to your computer and use it in GitHub Desktop.
Save JoshAshby/5175068 to your computer and use it in GitHub Desktop.
#Never done email in python however this seemed to work on my VPS with it's smtp server...
import smtplib
from email.mime.text import MIMEText
msg = MIMEText("This is a test")
msg['Subject'] = "test"
msg['To'] = "[email protected]"
msg['From'] = 'loki'
s = smtplib.SMTP('localhost')
s.sendmail("loki", ["[email protected]"], msg.as_string())
s.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment