Skip to content

Commit

Permalink
Fix email init error (#251)
Browse files Browse the repository at this point in the history
* 如果未启用邮箱发送就不进行初始化
  • Loading branch information
huanghyw authored Dec 30, 2020
1 parent 127e90b commit 73b5719
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def save_image(resp, image_file):
class Email():

def __init__(self, mail_user, mail_pwd, mail_host=''):
if global_config.getRaw('messenger', 'email_enable') == 'false':
return

smtpObj = smtplib.SMTP()
# 没传会自动判断 判断不出来默认QQ邮箱
if mail_host:
Expand Down

0 comments on commit 73b5719

Please sign in to comment.