fix exception class
This commit is contained in:
@@ -71,7 +71,7 @@ class SMTPTestAPI(APIView):
|
|||||||
to_email=request.data["email"],
|
to_email=request.data["email"],
|
||||||
subject="You have successfully configured SMTP",
|
subject="You have successfully configured SMTP",
|
||||||
content="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
|
# guess error message encoding
|
||||||
msg = b"Failed to send email"
|
msg = b"Failed to send email"
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user