GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 12.4.1 MimeWriter Objects

Previous Page Up One Level Next Page Python Library Reference Contents Module Index Index
Previous: 12.4 MimeWriter Up: 12.4 MimeWriter Next: 12.5 multifile


12.4.1 MimeWriter Objects

MimeWriter instances have the following methods:

addheader (key, value[, prefix])
Add a header line to the MIME message. The key is the name of the header, where the value obviously provides the value of the header. The optional argument prefix determines where the header is inserted; "0" means append at the end, "1" is insert at the start. The default is to append.

flushheaders ()
Causes all headers accumulated so far to be written out (and forgotten). This is useful if you don't need a body part at all, e.g. for a subpart of type message/rfc822 that's (mis)used to store some header-like information.

startbody (ctype[, plist[, prefix]])
Returns a file-like object which can be used to write to the body of the message. The content-type is set to the provided ctype, and the optional parameter plist provides additional parameters for the content-type declaration. prefix functions as in addheader() except that the default is to insert at the start.

startmultipartbody (subtype[, boundary[, plist[, prefix]]])
Returns a file-like object which can be used to write to the body of the message. Additionally, this method initializes the multi-part code, where subtype provides the multipart subtype, boundary may provide a user-defined boundary specification, and plist provides optional parameters for the subtype. prefix functions as in startbody(). Subparts should be created using nextpart().

nextpart ()
Returns a new instance of MimeWriter which represents an individual part in a multipart message. This may be used to write the part as well as used for creating recursively complex multipart messages. The message must first be initialized with startmultipartbody() before using nextpart().

lastpart ()
This is used to designate the last part of a multipart message, and should always be used when writing multipart messages.


Previous Page Up One Level Next Page Python Library Reference Contents Module Index Index
Previous: 12.4 MimeWriter Up: 12.4 MimeWriter Next: 12.5 multifile

See About this document... for information on suggesting changes.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.