Skip to content

Commit

Permalink
debug mail error on server
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeaktian committed Dec 12, 2018
1 parent 7dc3b9c commit 1d2ed5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ def addurl():
urls = request.form.get("urls")
emails = request.form.get("emails")
leavemes = request.form.get("leavemessage")
leavemes = str(leavemes)
leavemes = leavemes.decode('utf-8')
try:
mail_admin(urls, emails, leavemes)
except:
flash(u"提交失败,请重试! -_-||", category="warning")
return render_template('addurl.html')
# return render_template('addurl.html')
else:
flash(u"提交成功啦,主人已经收到你的请求了哦! ^_^", category="success")
return render_template('addurl.html')
# return render_template('addurl.html')
return render_template('addurl.html')
1 change: 1 addition & 0 deletions app/sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def send_mail(to_list,sub,content):
return False
def mail_admin(urls,email,mes):
message = str(urls) + " " + str(email) + " " + str(mes)
message = message.decode("utf-8")
for i in range(1): #发送1封,上面的列表是几个人,这个就填几
if send_mail(mailto_list,"互加友链请求",message):
return 1
Expand Down

0 comments on commit 1d2ed5d

Please sign in to comment.