You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to find this feature but I didn't find it. so I am trying to get status_code of the email's status like "If the email was successfully sent or failed" and "If failed then How email failed", I mean what reason effected the email failure. If the console is showing error like -
smtplib.SMTPRecipientsRefused: {'user': (553, b'5.1.3 The recipient address is not a valid RFC-5321 address. Learn\n5.1.3 more at\n5.1.3 https://support.google.com/mail/answer/6596 ik12-20020a170902ab0cm2094481plb.177 - gsmtp')}
or
socket.gaierror: [Errno 11001] getaddrinfo failed
so, A developer will want to show or pass the appropriate message to the user in frontend on "What went wrong" or "What causes the email failure" ? but in this case It will only be seen as "something went wrong" (No status code or a clean message) to pass forward.
Red Mail should not do any silencing on the error: whatever the smtplib raises will be passed through Red Mail to the user of the library. And the user can process the exception however needed.
Do you mean you would like to have better errors than what smtplib produces? Perhaps a valid point but it should be done with extreme care so that no information is lost. Error silencing for the sake of a status code is something I'm very against.
Furthermore, your example produces quite an intuitive exception though (you are missing a quote):
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials q3-20020a0565123a8300b00498fc3d4d15sm1004920lfu.190 - gsmtp')
I tried to find this feature but I didn't find it. so I am trying to get
status_code
of the email's status like "If the email was successfully sent or failed" and "If failed then How email failed", I mean what reason effected the email failure. If the console is showing error like -or
so, A developer will want to show or pass the appropriate message to the user in frontend on "What went wrong" or "What causes the email failure" ? but in this case It will only be seen as "something went wrong" (No status code or a clean message) to pass forward.
For Example -
and If I try to
print the EmailSender class calling variable
print(email)
. Then it printsClass object Binary
.so It would be better to show more information about email just sent.
The text was updated successfully, but these errors were encountered: