From 443fc226992cfcab54f5ddf7c2e1626ff24ff030 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Tue, 24 Apr 2018 07:06:33 +0800 Subject: [PATCH] fix exception class --- conf/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/views.py b/conf/views.py index a624e992..b3eaa082 100644 --- a/conf/views.py +++ b/conf/views.py @@ -71,7 +71,7 @@ class SMTPTestAPI(APIView): to_email=request.data["email"], subject="You have successfully configured SMTP", content="You have successfully configured SMTP") - except smtplib.SMTPException as e: + except smtplib.SMTPResponseException as e: # guess error message encoding msg = b"Failed to send email" try: