New submission from Jakub Wilk:
https://docs.python.org/3/library/email-examples.html#examples-using-the-provisional-api
contains the following code:
from email.headerregistry import Address
...
msg['From'] = Address("Pepé Le Pew", "[email protected]")
msg['To'] = (Address("Penelope Pussycat", "[email protected]"),
Address("Fabrette Pussycat", "[email protected]"))
But Address takes just the username, not the whole email address, as the second
argument. So this should be written as:
msg['From'] = Address("Pepé Le Pew", "pepe", "example.com")
...
or:
msg['From'] = Address("Pepé Le Pew", addr_spec="[email protected]")
...
----------
assignee: docs@python
components: Documentation
messages: 260796
nosy: docs@python, jwilk
priority: normal
severity: normal
status: open
title: email examples: incorrect use of email.headerregistry.Address
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26426>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com