Package email :: Module MIMEMultipart :: Class MIMEMultipart
[show private | hide private]
[frames | no frames]

Class MIMEMultipart

Message --+    
          |    
   MIMEBase --+
              |
             MIMEMultipart


Base class for MIME multipart/* type messages.

Method Summary
  __init__(self, _subtype, boundary, _subparts, **_params)
Creates a multipart/* type message.
    Inherited from Message
  __contains__(self, name)
  __delitem__(self, name)
Delete all occurrences of a header, if present.
  __getitem__(self, name)
Get a header value.
  __len__(self)
Return the total number of headers, including duplicates.
  __setitem__(self, name, val)
Set the value of a header.
  __str__(self)
Return the entire formatted message as a string.
  add_header(self, _name, _value, **_params)
Extended header setting.
  add_payload(self, payload)
Add the given payload to the current payload.
  as_string(self, unixfrom)
Return the entire formatted message as a string.
  attach(self, payload)
Add the given payload to the current payload.
  del_param(self, param, header, requote)
Remove the given parameter completely from the Content-Type header.
  get(self, name, failobj)
Get a header value.
  get_all(self, name, failobj)
Return a list of all the values for the named field.
  get_boundary(self, failobj)
Return the boundary associated with the payload if present.
  get_charset(self)
Return the Charset instance associated with the message's payload.
  get_charsets(self, failobj)
Return a list containing the charset(s) used in this message.
  get_content_charset(self, failobj)
Return the charset parameter of the Content-Type header.
  get_content_maintype(self)
Return the message's main content type.
  get_content_subtype(self)
Returns the message's sub-content type.
  get_content_type(self)
Return the message's content type.
  get_default_type(self)
Return the `default' content type.
  get_filename(self, failobj)
Return the filename associated with the payload if present.
  get_main_type(self, failobj)
Return the message's main content type if present.
  get_param(self, param, failobj, header, unquote)
Return the parameter value if found in the Content-Type header.
  get_params(self, failobj, header, unquote)
Return the message's Content-Type parameters, as a list.
  get_payload(self, i, decode)
Return a reference to the payload.
  get_subtype(self, failobj)
Return the message's content subtype if present.
  get_type(self, failobj)
Returns the message's content type.
  get_unixfrom(self)
  has_key(self, name)
Return true if the message contains the header.
  is_multipart(self)
Return True if the message consists of multiple parts.
  items(self)
Get all the message's header fields and values.
  keys(self)
Return a list of all the message's header field names.
  replace_header(self, _name, _value)
Replace a header.
  set_boundary(self, boundary)
Set the boundary parameter in Content-Type to 'boundary'.
  set_charset(self, charset)
Set the charset of the payload to a given character set.
  set_default_type(self, ctype)
Set the `default' content type.
  set_param(self, param, value, header, requote, charset, language)
Set a parameter in the Content-Type header.
  set_payload(self, payload, charset)
Set the payload to the given value.
  set_type(self, type, header, requote)
Set the main type and subtype for the Content-Type header.
  set_unixfrom(self, unixfrom)
  values(self)
Return a list of all the message's header values.
  walk(self)
Walk over the message tree, yielding each subpart.

Method Details

__init__(self, _subtype='mixed', boundary=None, _subparts=None, **_params)
(Constructor)

Creates a multipart/* type message.

By default, creates a multipart/mixed message, with proper
Content-Type and MIME-Version headers.

_subtype is the subtype of the multipart content type, defaulting to
`mixed'.

boundary is the multipart boundary string.  By default it is
calculated as needed.

_subparts is a sequence of initial subparts for the payload.  It
must be an iterable object, such as a list.  You can always
attach new subparts to the message by using the attach() method.

Additional parameters for the Content-Type header are taken from the
keyword arguments (or passed into the _params argument).
Overrides:
email.MIMEBase.MIMEBase.__init__

Generated by Epydoc 2.0 on Sun Sep 25 20:49:13 2005 http://epydoc.sf.net