Skip to content

Commit

Permalink
fix bugs about send mail
Browse files Browse the repository at this point in the history
  • Loading branch information
somewheve committed Feb 19, 2021
1 parent 7b1a5f2 commit 01aced2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ctpbee/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def send_message(self, title="ctpbee 日内邮件提醒", sub="日内邮件提
text = MIMEText(f"{datetime.now()} \n邮件类型: {sub}\n{message if message is not None else ''}")
email.attach(text)
try:
self.smtp.sendmail(self.user_email, self.to, email.as_string()) # 发送邮件
self.smtp_api.sendmail(self.user_email, self.to, email.as_string()) # 发送邮件
except smtplib.SMTPDataError as e:
print(f"{datetime.now()} 邮件发送失败 Reason: {e}")
except smtplib.SMTPServerDisconnected:
Expand Down

0 comments on commit 01aced2

Please sign in to comment.