email.contentmanager.set_content()

email.contentmanager.set_content(msg, , subtype="plain", charset='utf-8' cte=None, disposition=None, filename=None, cid=None, params=None, headers=None) email.contentmanager.set_content(msg, , maintype, subtype, cte="base64", disposition=None, filename=None, cid=None, params=None, headers=None) email.contentmanager.set_content(msg, , cte=None, disposition=None, filename=None, cid=None, params=None, headers=None) email.contentmanager.set_content(msg, , subtype='mixed', disposition=None, filena

email.contentmanager.raw_data_manager

email.contentmanager.raw_data_manager This content manager provides only a minimum interface beyond that provided by Message itself: it deals only with text, raw byte strings, and Message objects. Nevertheless, it provides significant advantages compared to the base API: get_content on a text part will return a unicode string without the application needing to manually decode it, set_content provides a rich set of options for controlling the headers added to a part and controlling the conten

email.contentmanager.get_content()

email.contentmanager.get_content(msg, errors='replace') Return the payload of the part as either a string (for text parts), an EmailMessage object (for message/rfc822 parts), or a bytes object (for all other non-multipart types). Raise a KeyError if called on a multipart. If the part is a text part and errors is specified, use it as the error handler when decoding the payload to unicode. The default error handler is replace.

email.contentmanager.ContentManager.set_content()

set_content(msg, obj, *args, **kw) If the maintype is multipart, raise a TypeError; otherwise look up a handler function based on the type of obj (see next paragraph), call clear_content() on the msg, and call the handler function, passing through all arguments. The expectation is that the handler will transform and store obj into msg, possibly making other changes to msg as well, such as adding various MIME headers to encode information needed to interpret the stored data. To find the handl

email.contentmanager.ContentManager.get_content()

get_content(msg, *args, **kw) Look up a handler function based on the mimetype of msg (see next paragraph), call it, passing through all arguments, and return the result of the call. The expectation is that the handler will extract the payload from msg and return an object that encodes information about the extracted data. To find the handler, look for the following keys in the registry, stopping with the first one found: the string representing the full MIME type (maintype/subtype) the stri

email.contentmanager.ContentManager.add_set_handler()

add_set_handler(typekey, handler) Record handler as the function to call when an object of a type matching typekey is passed to set_content(). For the possible values of typekey, see set_content().

email.contentmanager.ContentManager.add_get_handler()

add_get_handler(key, handler) Record the function handler as the handler for key. For the possible values of key, see get_content().

email.contentmanager.ContentManager

class email.contentmanager.ContentManager Base class for content managers. Provides the standard registry mechanisms to register converters between MIME content and other representations, as well as the get_content and set_content dispatch methods. get_content(msg, *args, **kw) Look up a handler function based on the mimetype of msg (see next paragraph), call it, passing through all arguments, and return the result of the call. The expectation is that the handler will extract the payload

email.charset.Charset.__str__()

__str__() Returns input_charset as a string coerced to lower case. __repr__() is an alias for __str__().

email.charset.Charset.__ne__()

__ne__(other) This method allows you to compare two Charset instances for inequality.