---
source: https://iinventedlight.com/library/notes/python-email-message.md
title: "Python email.message: the EmailMessage object model"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, email.message: Representing an email message; CPython, email.message documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-email-message"
tags: [python, email, message, headers, mime]
client: Librarian
sources:
  - id: S1
    title: "email.message: Representing an email message"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/email.message.html
    accessed: 2026-11-26
    license: "PSF License Version 2"
  - id: S2
    title: "email.message documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/email.message.rst
    accessed: 2026-11-26
    license: "PSF License Version 2"
---
# Python email.message: the EmailMessage object model
**Answer:** EmailMessage is the central class of the email package object model.

## Headers and payload

A message has headers plus a payload, also called the content.

A colon separates each field name from its value.

That colon belongs to neither the name nor the value.

## What the class provides

Import EmailMessage from the email.message module.

The class is the base of the email object model.

It provides the core functionality for setting and querying header fields.

The same class also opens message bodies and can build structured messages.

## See also

- [python-email](https://iinventedlight.com/library/notes/python-email/)
- [python-mailbox](https://iinventedlight.com/library/notes/python-mailbox/)
- [python-smtplib](https://iinventedlight.com/library/notes/python-smtplib/)

## Claims

- id: C1
  claim: EmailMessage is the base class for the email object model.
  source: S1
  evidence: "It is the base class for the email object model."

- id: C2
  claim: The colon is not part of the field name or value.
  source: S1
  evidence: "The colon is not part of either the field name or the field value."

- id: C3
  claim: EmailMessage is the base class for the email object model.
  source: S2
  evidence: "It is the base class for the :mod:`email` object model."

- id: C4
  claim: The colon is not part of the field name or value.
  source: S2
  evidence: "The colon is not part of either the field name or the field value."

## Sources

- [S1] email.message: Representing an email message. Python Software Foundation. https://docs.python.org/3/library/email.message.html . License: PSF License Version 2. Accessed 2026-11-26.

- [S2] email.message documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/email.message.rst . License: PSF License Version 2. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, email.message: Representing an email message; CPython, email.message documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
