Address
An Address is a str that holds one address in its display-name form.
Usage
Address()email.utils.formataddr writes the value, so a hand-written string with the same text is indistinguishable from it. See ADR-0014.
Parameters
name-
The display name, quoted or RFC 2047-encoded as needed. An empty name leaves the address bare.
email- The address, in ASCII. Pass a non-ASCII address as a plain string instead.
Raises
TypeError-
When
nameoremailis not astr. ValueError-
When
nameoremailholds a surrogate. Whenemailis not ASCII, with theUnicodeEncodeErroras__cause__.
Examples
from epistole import Address
Address("Ada Lovelace", "ada@example.com") # "Ada Lovelace <ada@example.com>"
Address("Lovelace, Ada", "ada@example.com") # '"Lovelace, Ada" <ada@example.com>'Methods
| Name | Description |
|---|---|
| __new__() | Return the formatted address. |
__new__()
Return the formatted address.
Usage
__new__(name, email)