A
Andrew McNamara
Given an email.Message.Message() object, what is the canonical way to
obtain a list of unicoded address headers? This is the effect I'm trying
to achieve, but it seems somewhat cumbersome:
obtain a list of unicoded address headers? This is the effect I'm trying
to achieve, but it seems somewhat cumbersome:
for t in getaddresses(m.get_all('to')+m.get_all('cc'))]>>> from email.Header import make_header, decode_header
>>> from email.Utils import formataddr, getaddresses
>>> [unicode(make_header(decode_header(formataddr(t))))