PyDocs

Nav

Internet Data Handling

Message.get_payload

  • Message.get_payload(i=None, decode=False)
Return a reference to the payload.

The payload will either be a list object or a string.  If you mutate
the list object, you modify the message's payload in place.  Optional
i returns that index into the payload.

Optional decode is a flag indicating whether the payload should be
decoded or not, according to the Content-Transfer-Encoding header
(default is False).

When True and the message is not a multipart, the payload will be
decoded if this header's value is `quoted-printable' or `base64'.  If
some other encoding is used, or the header is missing, or if the
payload has bogus data (i.e. bogus base64 or uuencoded data), the
payload is returned as-is.

If the message is a multipart and the decode flag is True, then None
is returned.
0 Examples
No examples for email.message/Message.get_payload.
See Also
No see-alsos for email.message/Message.get_payload
0 Notes
No notes for Message.get_payload