Skip to content

Instantly share code, notes, and snippets.

@kingofhawks
Created January 17, 2014 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kingofhawks/8470008 to your computer and use it in GitHub Desktop.
Save kingofhawks/8470008 to your computer and use it in GitHub Desktop.
send Mail via SMTP QQ
from email.mime.text import MIMEText
from smtplib import SMTP_SSL as SMTP #For TLS please use SMTP_SSL instead, such as QQ mail
#import smtplib
_user = "xxx@qq.com"
_pwd = "xxxx"
_to = "xxx@qq.com"
msg = MIMEText("Content")
msg["Subject"] = "Stock Price Threshold"
msg["From"] = _user
msg["To"] = _to
s = SMTP("smtp.qq.com")
s.login(_user, _pwd)
s.sendmail(_user, _to, msg.as_string())
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment