Base class for all exceptions that include an SMTP error code. These exceptions are generated in some instances when the SMTP server returns an error code. The error code is stored in the `smtp_code' attribute of the error, and the `smtp_error' attribute is set to the error message
| 86 | """ |
| 87 | |
| 88 | class SMTPResponseException(SMTPException): |
| 89 | """Base class for all exceptions that include an SMTP error code. |
| 90 | |
| 91 | These exceptions are generated in some instances when the SMTP |
| 92 | server returns an error code. The error code is stored in the |
| 93 | `smtp_code' attribute of the error, and the `smtp_error' attribute |
| 94 | is set to the error message. |
| 95 | """ |
| 96 | |
| 97 | def __init__(self, code, msg): |
| 98 | self.smtp_code = code |
| 99 | self.smtp_error = msg |
| 100 | self.args = (code, msg) |
| 101 | |
| 102 | class SMTPSenderRefused(SMTPResponseException): |
| 103 | """Sender address refused. |