Issue 36148: smtplib.SMTP.sendmail: mta status codes only accessible by local variables (original) (raw)

MTA status codes (visible via setdebuglevel(1)) are not accessible as the sendmail-method stores them only locally (code, resp).

I suggest to store the mta status codes, for instance: "250, b'2.0.0 Ok: queued as XYZ" etc. in an instance attribute (tuple) to access them on smtp-sessions.

As an email developer those information are very important to me.

Thanks for the PR, but this is a duplicate of #29539, which I think has a better API proposal. Since the original author never actually submitted a PR there, perhaps you could pick up his work (after pinging the issue).