Email and MIME Modules
email.contentmanager
Maps Python objects to message payloads and retrieves decoded content. The standard raw_data_manager handles common text, bytes and message objects. EmailMessage delegates set_content and get_content to its policy content manager; binary content requires media-type information.
Formal Syntax & Structure
python syntaxpython
import email.contentmanagerReturn Value
module
Module namespace available through import; import is a statement, not a value-returning expression.
Working Example
Example Snippetpython
from email.contentmanager import raw_data_managerfrom email.message import EmailMessagemessage = EmailMessage()raw_data_manager.set_content(message, "hello")print(raw_data_manager.get_content(message).strip())