代码拉取完成,页面将自动刷新
同步操作将从 didiplus/script 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# smtplib 用于邮件的发信动作
import smtplib
from loguru import logger
# email 用于构建邮件内容
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# 构建邮件头
from email.header import Header
from email.mime.application import MIMEApplication
class sendEmail:
def __init__(self,maillist:list,mailtitle:str,mailcontent) -> None:
self.mail_list = maillist
self.mail_title = mailtitle
self.mail_content = mailcontent
self.mail_host = "smtp.163.com"
self.mail_user = "your email name"
self.mail_pass = "your email password"
self.mail_postfix = "163.com"
def sendMail(self,Subject,file):
me = self.mail_user + "<" + self.mail_user + "@" + self.mail_postfix + ">"
msg = MIMEMultipart()
msg['Subject'] = Subject
msg ['From'] = me
msg['To'] = ";".join()(self.mail_list)
xlsxpart = MIMEApplication(open(file, 'rb').read())
xlsxpart.add_header('Content-Disposition', 'attachment', filename=file)
msg.attach(xlsxpart)
try:
s = smtplib.SMTP() #创建邮件服务器对象
s.connect(self.mail_host) #连接到指定的smtp服务器。参数分别表示smpt主机和端口
s.login(self.mail_user, self.mail_pass) #登录到你邮箱
logger.info("登录邮箱成功")
s.sendmail(me, self.mail_list, msg.as_string()) #发送内容
s.close()
return True
except Exception as e:
return False
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。