Skip to content

Instantly share code, notes, and snippets.

@kingofhawks
Created January 17, 2014 08:15
Show Gist options
  • 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 = "[email protected]"
_pwd = "xxxx"
_to = "[email protected]"
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