Lines Matching full:email
1 :mod:`email` --- An email and MIME handling package
4 .. module:: email
6 email messages.
11 **Source code:** :source:`Lib/email/__init__.py`
15 The :mod:`email` package is a library for managing email messages. It is
16 specifically *not* designed to do any sending of email messages to SMTP
18 :mod:`smtplib` and :mod:`nntplib`. The :mod:`email` package attempts to be as
23 The overall structure of the email package can be divided into three major
27 The central component of the package is an "object model" that represents email
29 object model interface defined in the :mod:`~email.message` sub-module. The
30 application can use this API to ask questions about an existing email, to
31 construct a new email, or to add or remove email subcomponents that themselves
32 use the same object model interface. That is, following the nature of email
33 messages and their MIME subcomponents, the email object model is a tree
34 structure of objects that all provide the :class:`~email.message.EmailMessage`
37 The other two major components of the package are the :mod:`~email.parser` and
38 the :mod:`~email.generator`. The parser takes the serialized version of an
39 email message (a stream of bytes) and converts it into a tree of
40 :class:`~email.message.EmailMessage` objects. The generator takes an
41 :class:`~email.message.EmailMessage` and turns it back into a serialized byte
46 The control component is the :mod:`~email.policy` module. Every
47 :class:`~email.message.EmailMessage`, every :mod:`~email.generator`, and every
48 :mod:`~email.parser` has an associated :mod:`~email.policy` object that
50 when an :class:`~email.message.EmailMessage` is created, either by directly
51 instantiating an :class:`~email.message.EmailMessage` to create a new email,
52 or by parsing an input stream using a :mod:`~email.parser`. But the policy can
53 be changed when the message is serialized using a :mod:`~email.generator`.
54 This allows, for example, a generic email message to be parsed from disk, but
55 to serialize it using standard SMTP settings when sending it to an email
58 The email package does its best to hide the details of the various governing
60 treat the email message as a structured tree of unicode text and binary
69 software (not just email), this will be a familiar concept to many programmers.
71 The following sections describe the functionality of the :mod:`email` package.
72 We start with the :mod:`~email.message` object model, which is the primary
74 :mod:`~email.parser` and :mod:`~email.generator` components. Then we cover the
75 :mod:`~email.policy` controls, which completes the treatment of the main
79 defects (non-compliance with the RFCs) that the :mod:`~email.parser` may
80 detect. Then we cover the :mod:`~email.headerregistry` and the
81 :mod:`~email.contentmanager` sub-components, which provide tools for doing more
90 The foregoing represent the modern (unicode friendly) API of the email package.
91 The remaining sections, starting with the :class:`~email.message.Message`
92 class, cover the legacy :data:`~email.policy.compat32` API that deals much more
93 directly with the details of how email messages are represented. The
94 :data:`~email.policy.compat32` API does *not* hide the details of the RFCs from
97 are still using the :mod:`~email.policy.compat32` API for backward
102 :class:`~email.message.EmailMessage`/:class:`~email.policy.EmailPolicy`
105 Contents of the :mod:`email` package documentation:
109 email.message.rst
110 email.parser.rst
111 email.generator.rst
112 email.policy.rst
114 email.errors.rst
115 email.headerregistry.rst
116 email.contentmanager.rst
118 email.examples.rst
124 email.compat32-message.rst
125 email.mime.rst
126 email.header.rst
127 email.charset.rst
128 email.encoders.rst
129 email.utils.rst
130 email.iterators.rst