On this page
smtplib.SMTPResponseException
Prev: smtplib.SMTPRecipientsRefused | Up: smtplib | Next: smtplib.SMTPSenderRefused
Rel: smtplib.quoteaddr, smtplib.quotedata, smtplib.SMTP, smtplib.SMTP_SSL
Ref: docs.python.org โ smtplib.SMTPResponseException
Tags: #public #python3 #stdlib #smtplib
Import
import smtplib
from smtplib import SMTPResponseException
Signature & Overview
smtplib.SMTPResponseException(code, msg)
Base class for all exceptions that include an SMTP error code.
Methods & Attributes
SMTPResponseException.add_note(self, note, /)โ Add a note to the exceptionSMTPResponseException.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import smtplib
exc = smtplib.SMTPResponseException(550, b'User unknown')
assert exc.smtp_code == 550
Gotchas
- Exposes
.smtp_codeand.smtp_error.
REPL Inspect
from smtplib import SMTPResponseException
help(SMTPResponseException)
Linked from
Related notes
- tuts/python3/stdlib_module/smtplib/SMTPRecipientsRefused Linked here; links to this page; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTPSenderRefused Linked here; links to this page; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/smtplib/quoteaddr Linked here; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/quotedata Linked here; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTP Linked here; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTP_SSL Linked here; shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTPAuthenticationError shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTPConnectError shared tags: #smtplib, #stdlib
- tuts/python3/stdlib_module/smtplib/SMTPDataError shared tags: #smtplib, #stdlib