diff --git a/project/auth.py b/project/auth.py index c0a1acc..63d4fff 100644 --- a/project/auth.py +++ b/project/auth.py @@ -117,7 +117,10 @@ def signup_post(): activation_code = gen_activation_code(new_user.email) from . import smtp - smtp.sendmail(new_user.email, "web-gpt激活码", "欢迎注册。您的激活码是:"+activation_code) + content = f"Hi {new_user.name},欢迎注册!\n" + content += f"您的激活码是:\n{activation_code}\n\n" + content += "此激活码十分钟内有效,过期请联系管理员激活,谢谢!" + smtp.sendmail(new_user.email, "web-gpt激活码", content) return redirect(url_for('auth.login'))