email.headerregistry.Address.domain

domain The domain portion of the address.

email.headerregistry.Address.display_name

display_name The display name portion of the address, if any, with all quoting removed. If the address does not have a display name, this attribute will be an empty string.

email.headerregistry.Address.addr_spec

addr_spec The username@domain portion of the address, correctly quoted for use as a bare address (the second form shown above). This attribute is not mutable.

email.headerregistry.Address

class email.headerregistry.Address(display_name='', username='', domain='', addr_spec=None) The class used to represent an email address. The general form of an address is: [display_name] <username@domain> or: username@domain where each part must conform to specific syntax rules spelled out in RFC 5322. As a convenience addr_spec can be specified instead of username and domain, in which case username and domain will be parsed from the addr_spec. An addr_spec must be a properly RFC qu

email.header.make_header()

email.header.make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' ') Create a Header instance from a sequence of pairs as returned by decode_header(). decode_header() takes a header value string and returns a sequence of pairs of the format (decoded_string, charset) where charset is the name of the character set. This function takes one of those sequence of pairs and returns a Header instance. Optional maxlinelen, header_name, and continuation_ws are as in the Header

email.header.Header.__str__()

__str__() Returns an approximation of the Header as a string, using an unlimited line length. All pieces are converted to unicode using the specified encoding and joined together appropriately. Any pieces with a charset of 'unknown-8bit' are decoded as ASCII using the 'replace' error handler. Changed in version 3.2: Added handling for the 'unknown-8bit' charset.

email.header.Header.__ne__()

__ne__(other) This method allows you to compare two Header instances for inequality.

email.header.Header.__eq__()

__eq__(other) This method allows you to compare two Header instances for equality.

email.header.Header.encode()

encode(splitchars=';, \t', maxlinelen=None, linesep='\n') Encode a message header into an RFC-compliant format, possibly wrapping long lines and encapsulating non-ASCII parts in base64 or quoted-printable encodings. Optional splitchars is a string containing characters which should be given extra weight by the splitting algorithm during normal header wrapping. This is in very rough support of RFC 2822‘s ‘higher level syntactic breaks’: split points preceded by a splitchar are preferred durin

email.header.Header.append()

append(s, charset=None, errors='strict') Append the string s to the MIME header. Optional charset, if given, should be a Charset instance (see email.charset) or the name of a character set, which will be converted to a Charset instance. A value of None (the default) means that the charset given in the constructor is used. s may be an instance of bytes or str. If it is an instance of bytes, then charset is the encoding of that byte string, and a UnicodeError will be raised if the string canno