smtplib documentation of mail_options/rcpt_options does not cover key-value case
smtplib's sendmailand send_message support the arguments mail_options and rcpt_options which both take a list of ESMTP options. However, the documentation does only describe the single word case not the key-value case.
The caller may pass a list of ESMTP options (such as 8bitmime) to be used in MAIL FROM commands as mail_options. ESMTP options (such as DSN commands) that should be used with all RCPT commands can be passed as rcpt_options.
To determine the correct format, users need to read the library source code. Maybe this could directly be extended to:
The caller may pass a list of ESMTP options as strings (such as "8bitmime") to be used in MAIL FROM commands as mail_options. ESMTP options (such as DSN commands) that should be used with all RCPT commands can be passed as rcpt_options (such as "NOTIFY=SUCCESS,FAILURE").
Linked PRs
- gh-132547
- gh-142796
- gh-142797