代码拉取完成,页面将自动刷新
同步操作将从 macroan/traderStock-gui 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#coding=utf-8
import smtplib
from email.mime.text import MIMEText
#"wanghuangan@163.com",
to_list = ["wanghuangan@163.com"]
mail_host = "smtp.163.com"
mail_user = "wanghuangan"
mail_pass = "123456"
mail_postfix="163.com"
def send_mail(sub, context):
me = mail_user + "<"+mail_user+"@"+mail_postfix+">"
msg = MIMEText(context, 'plain', 'utf-8')
msg['Subject'] = sub
msg['From'] = me
msg['To'] = ";".join(to_list)
try:
send_smtp = smtplib.SMTP()
send_smtp.connect(mail_host)
send_smtp.login(mail_user, mail_pass)
send_smtp.sendmail(me, to_list, msg.as_string())
send_smtp.close()
return True
except Exception, e:
print("send mail error!"+str(e))
return False
#发送邮件
'''
def send_Mail (Message, Dist):
TODAY = datetime.date.today()
CURRENTDAY=TODAY.strftime('%Y-%m-%d')
msg = MIMEMultipart()
TODAY = datetime.date.today()
CURRENTDAY=TODAY.strftime('%Y-%m-%d')
att = MIMEText(open(Dist+CURRENTDAY+'stock.csv', 'rb').read(), 'base64', 'gb2312') #设置附件的目录
att['content-type'] = 'application/octet-stream'
att['content-disposition'] = 'attachment;filename="stock.csv"' #设置附件的名称
msg.attach(att)
content = str(Message) #正文内容
body = MIMEText(content,'plain','GBK') #设置字符编码
msg.attach(body)
msgto = ['xx@126.com'] # 收件人地址多个联系人,格式['aa@163.com'; 'bb@163.com']
msgfrom = 'xx@126.com' # 寄信人地址 ,
msg['subject'] = 'Finish at '+CURRENTDAY #主题
msg['date']=time.ctime() #时间
#msg['Cc']='bb@junbao.net' #抄送人地址 多个地址不起作用
mailuser = 'xx' # 用户名
mailpwd = 'xx' #密码
try:
smtp = smtplib.SMTP()
smtp.connect(r'smtp.126.com')# smtp设置
smtp.login(mailuser, mailpwd) #登录
smtp.sendmail(msgfrom, msgto, msg.as_string()) #发送
smtp.close()
print "success mail"
except Exception, e:
print e
'''
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。