@@ -59,6 +59,16 @@ message objects.
5959 the Python standard ``\n `` line endings). For more information see the
6060 :mod: `~email.policy ` documentation.
6161
62+ .. note ::
63+
64+ The :class: `EmailMessage ` class requires a policy that provides a
65+ ``content_manager `` attribute (such as :class: `~email.policy.EmailPolicy `)
66+ for content management methods like :meth: `set_content ` and
67+ :meth: `get_content ` to work. The legacy :class: `~email.policy.Compat32 `
68+ policy does not support these methods. To serialize a message with
69+ compat32 formatting, construct the message with a modern policy and pass
70+ :const: `~email.policy.compat32 ` to :meth: `as_string ` or :meth: `as_bytes `.
71+
6272 .. method :: as_string(unixfrom=False, maxheaderlen=None, policy=None)
6373
6474 Return the entire message flattened as a string. When optional
@@ -603,6 +613,12 @@ message objects.
603613 *content_manager * is not specified, use the ``content_manager `` specified
604614 by the current :mod: `~email.policy `.
605615
616+ .. note ::
617+
618+ This method requires a policy with a ``content_manager `` attribute.
619+ The legacy :const: `~email.policy.compat32 ` policy does not support
620+ this method.
621+
606622
607623 .. method :: set_content(*args, content_manager=None, **kw)
608624
@@ -612,6 +628,12 @@ message objects.
612628 *content_manager * is not specified, use the ``content_manager `` specified
613629 by the current :mod: `~email.policy `.
614630
631+ .. note ::
632+
633+ This method requires a policy with a ``content_manager `` attribute.
634+ The legacy :const: `~email.policy.compat32 ` policy does not support
635+ this method.
636+
615637
616638 .. method :: make_related(boundary=None)
617639
0 commit comments