Email and MIME Modules

email.headerregistry

Defines structured header classes and address objects used by modern email policies. Address separates display name, local part and domain; parsing or constructing an address does not verify that a mailbox exists. HeaderRegistry chooses a parser for each header name.

Formal Syntax & Structure

python syntaxpython
import email.headerregistry

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
from email.headerregistry import Addressaddress = Address(display_name="Ada", username="ada", domain="example.invalid")print(address.addr_spec)
Python Reference