PyDocs

Nav

Internet Data Handling

formataddr

email.utils

function (source)
  • formataddr(pair, charset='utf-8')
The inverse of parseaddr(), this takes a 2-tuple of the form
(realname, email_address) and returns the string value suitable
for an RFC 2822 From, To or Cc header.

If the first element of pair is false, then the second element is
returned unmodified.

The optional charset is the character set that is used to encode
realname in case realname is not ASCII safe.  Can be an instance of str or
a Charset-like object which has a header_encode method.  Default is
'utf-8'.
Changed in 3.3
  • 3.3: Added the charset option.
0 Examples
No examples for email.utils/formataddr.
See Also
No see-alsos for email.utils/formataddr
0 Notes
No notes for formataddr