|
@@ -52,7 +52,7 @@ left join
|
|
|
application.app_kuaishou_material_info b
|
|
|
on a.signature=b.material_id; """.format(stat_date=self.stat_date)
|
|
|
print(sql)
|
|
|
- path = """/data/excel/kuaishou_material_month.xls""".format(stat_date=self.stat_date)
|
|
|
+ path = """/data/excel/send_material_report_month.xls""".format(stat_date=self.stat_date)
|
|
|
print(path)
|
|
|
pd.read_sql(sql, self.OuterConn).to_excel(path, index=False, engine='openpyxl')
|
|
|
my_sender = 'zhaohailiang@c-top.com.cn' # 发件人邮箱账号
|
|
@@ -65,12 +65,12 @@ on a.signature=b.material_id; """.format(stat_date=self.stat_date)
|
|
|
# [收件人邮箱昵称、收件人邮箱账号], 昵称随便
|
|
|
msg['To'] = ",".join(recipients)
|
|
|
# 邮件的主题,也就是邮件的标题
|
|
|
- msg['Subject'] = "快手-全量素材周报"
|
|
|
+ msg['Subject'] = "快手-全量素材月报"
|
|
|
|
|
|
att1 = MIMEText(
|
|
|
open(path, 'rb').read(), 'base64', 'utf-8')
|
|
|
att1["Content-Type"] = 'application/octet-stream'
|
|
|
- att1["Content-Disposition"] = 'attachment; filename="material_report_weekly.xls"'
|
|
|
+ att1["Content-Disposition"] = 'attachment; filename="send_material_report_month.xls"'
|
|
|
msg.attach(att1)
|
|
|
server = smtplib.SMTP_SSL("smtp.exmail.qq.com", port=465)
|
|
|
server.login(my_sender, my_pass)
|