email.message.EmailMessage.is_attachment()

is_attachment() Return True if there is a Content-Disposition header and its (case insensitive) value is attachment, False otherwise. Changed in version 3.4.2: is_attachment is now a method instead of a property, for consistency with is_multipart().

email.message.EmailMessage.make_related()

make_related(boundary=None) Convert a non-multipart message into a multipart/related message, moving any existing Content- headers and payload into a (new) first part of the multipart. If boundary is specified, use it as the boundary string in the multipart, otherwise leave the boundary to be automatically created when it is needed (for example, when the message is serialized).

email.message.EmailMessage.iter_attachments()

iter_attachments() Return an iterator over all of the parts of the message that are not candidate “body” parts. That is, skip the first occurrence of each of text/plain, text/html, multipart/related, or multipart/alternative (unless they are explicitly marked as attachments via Content-Disposition: attachment), and return all remaining parts. When applied directly to a multipart/related, return an iterator over the all the related parts except the root part (ie: the part pointed to by the st

email.message.EmailMessage.clear_content()

clear_content() Remove the payload and all of the Content- headers, leaving all other headers intact and in their original order.

email.message.EmailMessage.get_content()

get_content(*args, content_manager=None, **kw) Call the get_content method of the content_manager, passing self as the message object, and passing along any other arguments or keywords as additional arguments. If content_manager is not specified, use the content_manager specified by the current policy.

email.message.EmailMessage.add_related()

add_related(*args, content_manager=None, **kw) If the message is a multipart/related, create a new message object, pass all of the arguments to its set_content() method, and attach() it to the multipart. If the message is a non-multipart, call make_related() and then proceed as above. If the message is any other type of multipart, raise a TypeError. If content_manager is not specified, use the content_manager specified by the current policy. If the added part has no Content-Disposition heade

email.message.EmailMessage.get_body()

get_body(preferencelist=('related', 'html', 'plain')) Return the MIME part that is the best candidate to be the “body” of the message. preferencelist must be a sequence of strings from the set related, html, and plain, and indicates the order of preference for the content type of the part returned. Start looking for candidate matches with the object on which the get_body method is called. If related is not included in preferencelist, consider the root part (or subpart of the root part) of an

email.message.EmailMessage.add_attachment()

add_attachment(*args, content_manager=None, **kw) If the message is a multipart/mixed, create a new message object, pass all of the arguments to its set_content() method, and attach() it to the multipart. If the message is a non-multipart, multipart/related, or multipart/alternative, call make_mixed() and then proceed as above. If content_manager is not specified, use the content_manager specified by the current policy. If the added part has no Content-Disposition header, add one with the va

email.message.EmailMessage.clear()

clear() Remove the payload and all of the headers.

email.message.EmailMessage.add_alternative()

add_alternative(*args, content_manager=None, **kw) If the message is a multipart/alternative, create a new message object, pass all of the arguments to its set_content() method, and attach() it to the multipart. If the message is a non-multipart or multipart/related, call make_alternative() and then proceed as above. If the message is any other type of multipart, raise a TypeError. If content_manager is not specified, use the content_manager specified by the current policy.