Skip to content

Instantly share code, notes, and snippets.

@gaybro8777
Forked from kingofhawks/smtp_qq.py
Created April 21, 2019 12:52
Show Gist options
  • Save gaybro8777/6fd599f2f5296e910ef2d67184f11c30 to your computer and use it in GitHub Desktop.
Save gaybro8777/6fd599f2f5296e910ef2d67184f11c30 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