summaryrefslogtreecommitdiff
path: root/Doc/library/smtplib.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2015-05-17 19:27:22 -0400
committerR David Murray <rdmurray@bitdance.com>2015-05-17 19:27:22 -0400
commit8308444eefee8a6b5bb58b9f51a29d1a8d3683bf (patch)
treedd907f25915c28b10af8b14901ab2a90687576a7 /Doc/library/smtplib.rst
parent740d6134f15cd9641a7c9d953269a07a99d02a2b (diff)
downloadcpython-git-8308444eefee8a6b5bb58b9f51a29d1a8d3683bf.tar.gz
#24218: Add SMTPUTF8 support to send_message.
Reviewed by Maciej Szulik.
Diffstat (limited to 'Doc/library/smtplib.rst')
-rw-r--r--Doc/library/smtplib.rst12
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 133fa5621e..25279f23cb 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -467,7 +467,7 @@ An :class:`SMTP` instance has the following methods:
If *from_addr* is ``None`` or *to_addrs* is ``None``, ``send_message`` fills
those arguments with addresses extracted from the headers of *msg* as
- specified in :rfc:`2822`\: *from_addr* is set to the :mailheader:`Sender`
+ specified in :rfc:`5322`\: *from_addr* is set to the :mailheader:`Sender`
field if it is present, and otherwise to the :mailheader:`From` field.
*to_adresses* combines the values (if any) of the :mailheader:`To`,
:mailheader:`Cc`, and :mailheader:`Bcc` fields from *msg*. If exactly one
@@ -482,10 +482,18 @@ An :class:`SMTP` instance has the following methods:
calls :meth:`sendmail` to transmit the resulting message. Regardless of the
values of *from_addr* and *to_addrs*, ``send_message`` does not transmit any
:mailheader:`Bcc` or :mailheader:`Resent-Bcc` headers that may appear
- in *msg*.
+ in *msg*. If any of the addresses in *from_addr* and *to_addrs* contain
+ non-ASCII characters and the server does not advertise ``SMTPUTF8`` support,
+ an :exc:`SMTPNotSupported` error is raised. Otherwise the ``Message`` is
+ serialized with a clone of its :mod:`~email.policy` with the
+ :attr:`~email.policy.EmailPolicy.utf8` attribute set to ``True``, and
+ ``SMTPUTF8`` and ``BODY=8BITMIME`` are added to *mail_options*.
.. versionadded:: 3.2
+ .. versionadded:: 3.5
+ Support for internationalized addresses (``SMTPUTF8``).
+
.. method:: SMTP.quit()