PyDocs

Nav

Internet Data Handling

Message.as_string

  • Message.as_string(unixfrom=False, maxheaderlen=0, policy=None)
Return the entire formatted message as a string.

Optional 'unixfrom', when true, means include the Unix From_ envelope
header.  For backward compatibility reasons, if maxheaderlen is
not specified it defaults to 0, so you must override it explicitly
if you want a different maxheaderlen.  'policy' is passed to the
Generator instance used to serialize the message; if it is not
specified the policy associated with the message instance is used.

If the message object contains binary data that is not encoded
according to RFC standards, the non-compliant data will be replaced by
Unicode "unknown character" code points.
Changed in 3.4
  • 3.4: the policy keyword argument was added.
0 Examples
No examples for email.message/Message.as_string.
See Also
No see-alsos for email.message/Message.as_string
0 Notes
No notes for Message.as_string