email.mime.message.MIMEMessage

class email.mime.message.MIMEMessage(_msg, _subtype='rfc822') Module: email.mime.message A subclass of MIMENonMultipart, the MIMEMessage class is used to create MIME objects of main type message. _msg is used as the payload, and must be an instance of class Message (or a subclass thereof), otherwise a TypeError is raised. Optional _subtype sets the subtype of the message; it defaults to rfc822.

email.mime.nonmultipart.MIMENonMultipart

class email.mime.nonmultipart.MIMENonMultipart Module: email.mime.nonmultipart A subclass of MIMEBase, this is an intermediate base class for MIME messages that are not multipart. The primary purpose of this class is to prevent the use of the attach() method, which only makes sense for multipart messages. If attach() is called, a MultipartConversionError exception is raised.

email.mime.text.MIMEText

class email.mime.text.MIMEText(_text, _subtype='plain', _charset=None) Module: email.mime.text A subclass of MIMENonMultipart, the MIMEText class is used to create MIME objects of major type text. _text is the string for the payload. _subtype is the minor type and defaults to plain. _charset is the character set of the text and is passed as an argument to the MIMENonMultipart constructor; it defaults to us-ascii if the string contains only ascii code points, and utf-8 otherwise. The _charset

email.mime.base.MIMEBase

class email.mime.base.MIMEBase(_maintype, _subtype, **_params) Module: email.mime.base This is the base class for all the MIME-specific subclasses of Message. Ordinarily you won’t create instances specifically of MIMEBase, although you could. MIMEBase is provided primarily as a convenient base class for more specific MIME-aware subclasses. _maintype is the Content-Type major type (e.g. text or image), and _subtype is the Content-Type minor type (e.g. plain or gif). _params is a parameter key

email.mime.audio.MIMEAudio

class email.mime.audio.MIMEAudio(_audiodata, _subtype=None, _encoder=email.encoders.encode_base64, **_params) Module: email.mime.audio A subclass of MIMENonMultipart, the MIMEAudio class is used to create MIME message objects of major type audio. _audiodata is a string containing the raw audio data. If this data can be decoded by the standard Python module sndhdr, then the subtype will be automatically included in the Content-Type header. Otherwise you can explicitly specify the audio subtyp

email.mime.application.MIMEApplication

class email.mime.application.MIMEApplication(_data, _subtype='octet-stream', _encoder=email.encoders.encode_base64, **_params) Module: email.mime.application A subclass of MIMENonMultipart, the MIMEApplication class is used to represent MIME message objects of major type application. _data is a string containing the raw byte data. Optional _subtype specifies the MIME subtype and defaults to octet-stream. Optional _encoder is a callable (i.e. function) which will perform the actual encoding o

email.message_from_string()

email.message_from_string(s, _class=email.message.Message, *, policy=policy.compat32) Return a message object structure from a string. This is exactly equivalent to Parser().parsestr(s). _class and policy are interpreted as with the Parser class constructor. Changed in version 3.3: Removed the strict argument. Added the policy keyword.

email.message_from_file()

email.message_from_file(fp, _class=email.message.Message, *, policy=policy.compat32) Return a message object structure tree from an open file object. This is exactly equivalent to Parser().parse(fp). _class and policy are interpreted as with the Parser class constructor. Changed in version 3.3: Removed the strict argument. Added the policy keyword.

email.message.MIMEPart

class email.message.MIMEPart(policy=default) This class represents a subpart of a MIME message. It is identical to EmailMessage, except that no MIME-Version headers are added when set_content() is called, since sub-parts do not need their own MIME-Version headers.

email.message.Message.__str__()

__str__() Equivalent to as_string(). Allows str(msg) to produce a string containing the formatted message.