Skip to content

Commit

Permalink
哎 修复好了应该
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Nov 26, 2021
1 parent 7e4bc9e commit bcece8e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/core/msg/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def send_msg(subject, content, attachment=None, *receiver):
message = MIMEText(content, 'html', 'utf-8')
message['From'] = sender
# 抄送给自己一份
message['CC'] = sender
message['To'] = Header(to, 'utf-8')
message['Subject'] = Header(subject, 'utf-8')
message['Message-ID'] = make_msgid()
Expand All @@ -43,7 +42,7 @@ def send_msg(subject, content, attachment=None, *receiver):
# 我们用set_debuglevel(1)就可以打印出和SMTP服务器交互的所有信息。
smtp.set_debuglevel(1)
smtp.login(sender, data.get("password"))
smtp.sendmail(sender, list(receiver), message.as_string())
smtp.sendmail(sender, [sender, *receiver], message.as_string())
except Exception as e:
raise Exception(f"发送测试报告邮件失败: {e}")

Expand Down

0 comments on commit bcece8e

Please sign in to comment.