Skip to content

Instantly share code, notes, and snippets.

@shakkhar
Created July 21, 2013 03:55
Show Gist options
  • Save shakkhar/6047409 to your computer and use it in GitHub Desktop.
Save shakkhar/6047409 to your computer and use it in GitHub Desktop.
Sending emails from python using smtplib
import smtplib
from email.mime.text import MIMEText
msg = MIMEText("this is a test message")
s = smtplib.SMTP("__SMTP_SERVER_ADDRESS__")
s.starttls()
s.login("__SMTP_USER_NAME__","__SMTP_PASSWORD__")
s.sendmail("__SENDER_EMAIL__", ["__RECIPIENT_EMAIL__"], msg.as_string())
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment