Message193711
No, but you can do this:
>>> utils.getaddresses(['a@example.com, b@example.com'])
[('', 'a@example.com'), ('', 'b@example.com')]
Not the worlds most intuitive API, I know...which is why we have implemented a new improved API. In 3.3, by using the new (provisional) policies, you can get a parsed list of addresses right from the Message object, without having to do any further processing yourself:
>>> import email.policy
>>> m = email.message_from_string('To: a@example.com, b@example.com\n\n', policy=email.policy.default)
>>> m['to']
'a@example.com, b@example.com'
>>> m['to'].addresses
(Address(display_name='', username='a', domain='example.com'), Address(display_name='', username='b', domain='example.com'))
This new code is not as battle tested as the old code, so I need people to try using it in order to find the bugs :) |
|
Date |
User |
Action |
Args |
2013-07-25 18:43:07 | r.david.murray | set | recipients:
+ r.david.murray, barry, lpirl |
2013-07-25 18:43:07 | r.david.murray | set | messageid: <1374777787.48.0.683613025293.issue18557@psf.upfronthosting.co.za> |
2013-07-25 18:43:07 | r.david.murray | link | issue18557 messages |
2013-07-25 18:43:07 | r.david.murray | create | |
|