def SendMail(self): self.getNow() with open(self.root + self.student.name + "本学期成绩" + ".txt", "r", encoding="utf-8") as f: data = f.readlines() SendEmail(''.join(data))
def __init__(self, user_name: str, password: str, qq: str, other_config: dict): self.user_name = user_name self.password = password self.qq = qq self.WATCH_TIME_INTERVAL = other_config['interval'] self.TIME_DELTA = other_config['time_delta'] self.visited_items = self.get_read_items() self.data = self.get_items() self.email_sender = SendEmail("学习通消息通知")
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: send_email.py import sys reload(sys) sys.setdefaultencoding('utf-8') from mail import SendEmail content = "这是一封来自DNS监控的测试邮件,请勿回复!" title = "这是一封来自DNS监控的测试邮件,请勿回复!" mailto_list = [ '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**' ] mail = SendEmail('smtp.efly.cc', '*****@*****.**', 'eflydns123') mail.sendTxtMail(mailto_list, title, content)
#pprint(ret) string = ret['description'] string = string.split('\n') string = string[3] string = string[0:-8] string = string.split(', ') weather = string[0] tp = string[1] title = '肥猪心,早晨,今日圣安天气:' + str(weather) + ',当前体感温度:' + str(tp) + "℃,气温渐冷,注意保暖" content = "<h1>早晨啦,亲!</h1><br><h1>今天天气:" + str(weather) + ",当前体感温度:" + str( tp ) + "℃</h1><br><h1>正式上课了!不要再赖床了!记得忙碌之余多活动活动,多喝水,别再熬夜了</h1><br><h1>注意身体,有空的话多留点时间跟我Facetime啦!</h1><br><h1>爱你!</h1>" mailto_list = ['*****@*****.**'] #mailto_list = ['*****@*****.**'] mail = SendEmail('smtp.163.com', '*****@*****.**', 'xinyi520') if mail.sendImageMail(mailto_list, title, content): print "发送成功" else: print "发送失败" backup_list = ['*****@*****.**'] mail = SendEmail('smtp.163.com', '*****@*****.**', 'xinyi520') if mail.sendImageMail(backup_list, title, content): print "发送成功" else: print "发送失败"
from pic import PictureMaker from deleter import TrashCan app = Flask(__name__) # set it to a random string app.secret_key = 'any random string that are long enough' # set this to path/to/your/database/backend/program database_exec_path = './train_modified' rand_exec_path = './gen_rand' graph_exec_path = './static/' app.pipe = PipeLine(database_exec_path) app.rand = PipeLine(rand_exec_path) app.email = SendEmail() app.pic_make = PictureMaker(graph_exec_path) app.trash_can = TrashCan() # add_train 1 C1001(长春-延吉西) C 4 2 硬卧 软卧 # 长春 xx:xx 05:47 xx:xx ¥0.0 ¥0.0 # 吉林 06:27 06:29 00:02 ¥478.97 ¥980.89 # 敦化 07:23 07:25 00:02 ¥911.62 ¥2748.9 # 延吉西 08:04 08:04 xx:xx ¥1454.54 ¥2489.5 class StationInfo(object): def __init__(self, seat_num): self.name = None self.arrive = None self.leave = None