Building and Parsing MIME Messages
Table of Contents | Previous | Next | Index

Messaging Access SDK Guide
Part 1. Using the Messaging Access SDK


Chapter 3
Building and Parsing MIME Messages

This chapter is an overview of using the MIME (Multipurpose Internet Mail Extension) API of the Messaging Access SDK to encode, decode, and parse mail messages, and handle text and non-text attachments.

[Top]

The MIME Protocol

The MIME (Multipurpose Internet Mail Extension) protocol is the solution for sending multipart, multimedia, and binary data over the Internet. MIME is the standard for sending a variety of data types, including video, audio, images, programs, formatted documents, and text, in email messages.

The MIME protocol is made up of the extensions to the Internet mail format documented in RFC 822, "Standard for the Format of ARPA Internet Text Messages," August 1982. The MIME protocol, documented in a series of MIME RFCs, adds these features:

MIME messages can include attachments and non-ASCII data. To conform with RFC 822, which requires mail message characters to be in ASCII, MIME uses an encoding algorithm to convert binary data to ASCII characters. For content that requires encoding, MIME specifies two encoding types, either Quoted-Printable or BASE64, which are described more fully in MIME Encoding Types.

The MIME API of the Messaging Access SDK provides the ability to build multimedia messages in MIME format plus a parsing facility for messages. The MIME parser takes a MIME-encoded email message and decodes all or parts of it, depending on the preferences of the application. The MIME parser is described in Parsing MIME Messages.

For detailed information about MIME, consult one of the RFCs listed, with links, in MIME RFCs.

[Top]

MIME Encoding Types

MIME messages can include attachments and non-ASCII data. RFC 822 requires mail message characters to be in ASCII, so MIME uses an encoding algorithm to convert binary data to ASCII characters. MIME uses one of two encoding types, Quoted-Printable and BASE64 encoding.

Quoted printable encoding handles content that is mostly composed of ASCII characters, with only a small number that are non-ASCII (for example, Scandinavian characters in the ISO-8859-1 character set). This text is mostly readable on the client before it is encoded. The encoding process ignores ASCII characters and encodes the rest, using a set of rules for representing characters, line breaks, and tabs, and limiting line length.

BASE64 encoding handles binary data. This algorithm works by encoding sets of a octets into encoded characters, and produces 33 percent data expansion.

The MIME API also supports a non-encoding option. For example, no encoding is required for text messages.

For detailed information about MIME encoding, consult one of the RFCs listed, with links, in MIME RFCs.

[Top]

MIME Content Types

MIME types typically have three parts, a type, a subtype and optional content-type parameters. The type is the general content category; the subtype is the specific data format, as shown in these examples:

This table lists the valid MIME content types. A valid subtype can be of any data format type, including numerous experimental formats.

Table 3.1 MIME Content Types

Type Description Subtypes

Text

Information in raw text form. Has optional character set (default: us-ascii).

plain: includes no formatting information

Audio

Message body contains audio data.

basic

Image

Message body contains an image.

image format name, for
example: gif, jpeg

Video

Message body contains a time-varying-picture image, possibly with color and sound.

image format name,
for example: mpeg

Application

Uninterpreted binary data or information to be processed by an application.

octet-stream, postscript

Multipart

Messages with multiple attachments of potentially different media. Subtypes describe how the sub-parts relate.

mixed, alternative,
digest, parallel

Message

Identifies a message.

rfc822, partial,
external-body

The MIME implementation of the Messaging Access SDK provides functions that create these content types, add them to messages, and encode or decode them.

For detailed information about MIME content types, subtypes, and content parameters, consult one of the RFCs listed, with links, in MIME RFCs.

[Top]

Structure of a MIME Message

A MIME message has two main parts, the header and the body.

Figure 3.1   Parts of a MIME message

The message header consists of lines that describe the sender, subject, recipient, date, version of MIME in use, and a variety of other types of information, depending on the needs of the messaging application. This example shows the header lines of a message.

Return-Path:

<Prasad@netscape.com>

Received:

from netscape.com ([205.217.229.85])by dredd.mcom.com (Netscape Messaging Server 3.0) with ESMTP id AAA24896; Wed, 4 Feb 1998 20:08:19 -0800

Sender:

prasad

Message-ID:

<34D93795.C1F48C83@netscape.com>

Date:

Wed, 04 Feb 1998 19:52:53 -0800

From:

Prasad Yendluri <Prasad@netscape.com>

X-Mailer:

Mozilla 4.03C-NSCP [en] (X11; U; SunOS 5.5.1 sun4u)

MIME-Version:

1.0

To:

sharonw@netscape.com

Subject:

Information about MIME

Content-Type:

multipart/mixed; boundary =
"------------ BFA9E722569728E3111F0326"

For more information, see Adding Message Headers.

The message body consists of body parts of different types, depending on the demands of the data in the message.

For more information, see Building the MIME Message.

[Top]

Steps in a MIME Session

The basic MIME operations focus on preparing a message to be sent and translating a received message into readable form for a mail application. Before the MIME message can be sent, the message and its attachments must be built and encoded in MIME format. When a message is received, it must be parsed and decoded.

Generally, a messaging application follows these steps when using MIME to build a message.

Figure 3.2   Translating a MIME Message

[Top]

Building the MIME Message

Before sending a MIME message, you must build the message and its attachments and encode them in MIME format. This section describes the steps in building a message.

You can build MIME messages from RFC headers and simple text or attachments or both. You have the option of either building the message part by part, or using one of the convenience functions provided by the API.

There are two stages in building a message.

First, create an empty message structure. This example creates a pointer to a message called pNewMessage.

mime_message_t *pNewMimeMessage = 
   (
mime_message_t *) mime_malloc (sizeof (mime_message_t));
Then, add two components, in either order.

You can also create a message with mime_message_create, a convenience function that builds a MIME message structure:

int mime_message_create (char * in_pText, 
                         char * in_pFileFullName,
                         mime_encoding_type in_perf_file_encoding,
                         mime_message_t ** out_ppMessage);
You provide the filename of an attachment or text; one of these is required. Also, supply the file encoding type to use (either Base64, Quoted Printable, or -1 to use a default). This function creates a message, to which you add the headers.

One of the sample applications in the examples directory of the SDK illustrates building a message using this function.

The following section of code demonstrates using mime_message_create to build a MIME message with text, a data buffer, and a file.

/* Build a MIME Message with "text" and the file "/tmp/testfile.txt" */
ret = mime_message_create (pBuf, "/tmp/testfile.txt", enc, &pMsg);
/* Build a message with just text and NO file. */
ret = mime_message_create (pBuf, NULL, 0, &pMsg);
/* Build a message with just a file and NO text. */
ret = mime_message_create (NULL, "/tmp/testfile.txt", 0, &pMsg); 
Next, add the headers to the message. See Adding Message Headers.

[Top]

Adding Message Headers

After building a message, add the message headers. To do this, use the mime_header_new function. You supply the header name and value. This function creates a header entry as a name:value pair and adds it to the message.

mime_header_t * pHdr = mime_Header_new (
                char * in_pName, char * in_pValue);
To create a header, this function populates a mime_header_t structure with the name and value parameters you specify. Now you can add this header to the RFC 822 header part of the MIME message.

The following section of code creates RFC 822-compliant headers for a MIME message.

mime_header_new ("From", "prasad@netscape.com"); 
mime_header_new ("To", "smith@netscape.com"); 
mime_header_new ("Subject", "Using MIME"); 
mime_header_new ("X-Msg-SDK-HDR", "X-Test-Value1"); 
When the headers are created, add them to the rfc822_headers member of the MIME message structure mime_messagePart_t.

Next, you can add any of the other message parts or attachments that the message requires. See Adding Content to the Message.

[Top]

Adding Content to the Message

To add content to a message, you first create a message body part, then use MIME API functions to add the data to the part. You can then add this part, which now contains data, to the message. A MIME message can include the following types of body parts:

Creating the Basic Part and Adding Data

Before you can add a basic part, you first create the basic part structure, mime_basicPart_t. This is the common structure for the leaf parts, text, audio, video, image, and application.

Create the basic part by defining the mime_basicPart_t structure and setting up the attributes of the part, including elements such as content description, content type, and headers, including X-headers.

After you set up the basic part structure and its attributes, you can add the body data to the structure. To do this, use either mime_basicPart_setDataBuf or mime_basicPart_setDataStream, depending on the source of the data.

int mime_basicPart_setDataBuf (
               mime_basicPart_t * in_pBasicPart,
               unsigned int in_size,
               const char * in_pDataBuf,
               BOOLEAN in_fCopyData);
The in_pBasicPart parameter identifies the basic part that you are adding the data to; you must already have created this part. The in_pDataBuf parameter represents the data source. Use the in_fCopyData parameter to specify whether to the function should copy the data or keep a reference to the data buffer.

Repeat this for each basic part you add to the multipart.

The mime_basicPart_setDataStream function works in the same way, except that the data source is an input stream.

int mime_basicPart_setDataStream (
               mime_basicPart_t * in_pBasicPart,
               mime_inputstream_t * in_ptheDataStream,
               BOOLEAN in_fCopyData);
Now you can add this part to the message. See Adding Parts to the Message.

[Top]

Building a Multipart

If a message has two or more attachments, you must create a multipart that includes them before you can add them the message.

This example demonstrates creating a multipart.

mime_multiPart_t * pMultiPart = (mime_multiPart_t *) 
               mime_malloc (sizeof (mime_multiPart _t);
To add basic parts to a multipart, use one of these MIME API functions:

Adding a Basic Part to a Multipart

Before you can add a basic part to a multipart, you must create the basic part structure and add data to it. See Creating the Basic Part and Adding Data.

When the basic part is complete, you can it to the multipart. To do this, use mime_multiPart_addBasicPart.

int mime_multiPart_addBasicPart (
               mime_multiPart_t * in_pMultiPart,
               mime_basicPart_t * in_pBasicPart,
               BOOLEAN in_fClone,
               int * out_index_assigned);
You supply the existing basic part that you are adding, the multipart to add it to, and the index at which you want to add it. Use the in_fClone parameter to specify whether to the function should keep a reference to the body part object itself or a cloned copy. Repeat this for each basic part you add to the multipart.

After creating and assembling the multipart, the next step is to add the multipart to the message. See Adding Parts to the Message.

[Top]

Adding Parts to the Message

After you create the MIME message structure and the body parts you want it to include, use the MIME Message function group to add the parts to the message. Different functions add basic parts, multiparts, and message parts.

For example, when the basic part is complete and includes data, as described in Creating the Basic Part and Adding Data, add it to the message with the mime_message_addBasicPart function, shown here:

int mime_message_addBasicPart (
               mime_message_t * in_pMessage,
               mime_basicPart_t * in_pBasicPart,
               BOOLEAN in_fClone);
The basic part becomes the body of the message. The content-type of the message is set according to the content type of the basic part. If the message already has a message body, an error occurs. Use the in_fClone parameter to specify whether to the function should keep a reference to the body part object itself or a cloned copy.

You can simplify the process of building and adding content to a message by using the convenience function mime_message_create. You supply text, a file to attach, and the encoding type. The function creates a message, to which you add the headers. For more information about this function, see Building the MIME Message.

[Top]

Adding a Message Part to a Message

When you forward a message, it becomes the content of another message. This means that the mail application must do two things:

To make a message part from the message structure, use this function:

int mime_messagePart_fromMessage (
               mime_message_t * in_pMessage,
               mime_messagePart_t ** out_ppMessagePart()
This function takes the message structure and returns it as a message part.

To add the message part as the body of the message, use this function.

int mime_message_addMessagePart (
               mime_message_t * in_pMessage,
               mime_messagePart_t * in_pMessagePart,
               BOOLEAN in_fClone);
This function fails if a message body already exists. The clone parameter should contain true if the function should clone a copy of the message or false if it should store a reference to the passed object.

[Top]

Deleting Parts of a Message

If you want to delete the message, a body part (or parts of it) after it is built, use one of the MIME delete functions. You can delete the entire message, the body, or a message part, as needed.

[Top]

Encoding the Message

After building a message, the next step is to encode it. You can encode an entire message, with headers and message attachments, in one operation with the mime_message_putByteStream function. Encoding puts messages into MIME canonical form, so that they can be transmitted over SMTP and other transport functions.

int mime_message_putByteStream (
         mime_message_t * in_pMessagePart,
         mime_outputstream_t * in_pOutput_stream);
The function required pointers to the message that contains data to encode and to the MIME output stream for the encoded data. For the SDK functions that create input and output streams, see Shared Functions.

After the message is encoded, you can send it using SMTP. For information about SMTP, see Chapter 2, "Sending Mail with SMTP."

The following section of code writes the MIME-encoded message to the specified target, in this case, a file.

/* Writes the MIME encoded message to a file */
sprintf (filename, "%s%s", TMPDIR, "sdkCEnc.out");
file_outputStream_create (filename, &pOS);
mime_message_putByteStream (pMsg, pOS);
file_outputStream_close (pOS->rock);
nsStream_free (pOS);
[Top]

Encoding and Decoding Utilities

The MIME API provides a number of utility functions for encoding and decoding. These functions are used by other MIME API functions internally, and are also made available to developers to use in their applications.

The mime_message_putByteStream function could call either of two encoding utility functions, mime_encodeBase64 or mime_encodeQP, based on whether the requested encoding type is Base64 (default for non-text types) or Quoted Printable. These utility functions each provide a single form of encoding. Like mime_message_putByteStream, these functions take an input stream and encode it. If an application requires only Base64 or QP-encoded data, you can use one of these functions in place of mime_message_putByteStream.

The parseEntireMessage and parseEntireMessageInputstream functions, which parse and decode encoded messages, could call either of two decoding utility methods, mime_decodeBase64 or mime_decodeQP, based on the requested encoding type. These utility methods each provide a single form of decoding, and could be used instead of parseEntireMessage if an application only needs to decode Base64 or QP-encoded data.

[Top]

Encoding and Decoding Headers

Two utility functions allow you to encode and decode only the headers of a message.

[Top]

Parsing MIME Messages

For parsing encoded messages, the Messaging Access SDK provides these options:

[Top]

Parsing the Entire Message

You can use MIME functions to parse and decode encoded messages retrieved through email protocol APIs, such as POP3 and IMAP4.

The MIME API of the Messaging Access SDK provides two functions for parsing an entire MIME message in one operation. These functions either parse a message that comes from a data buffer or from an input stream. Both return a MIME Message structure that represents the parsed message. They are defined in mimeparser.h.

To parse a message from a data buffer, use parseEntireMessage:

mime_message_t * parseEntireMessage (char *pData, 
               int nLen,
               struct mime_message ** ppMimeMessage);
Supply a pointer to the message data and the length of the data. The function returns the parsed message.

To parse a message from an input stream, use parseEntireMessageInputstream:

int parseEntireMessageInputstream(
               struct nsmail_inputstream *pInput,
               struct mime_message **ppMimeMessage);
Supply the identifier for the stream that is the source of the data and the destination of the message. For the SDK functions that create input and output streams, see Shared Functions.

The following section of code uses parseEntireMessageInputstream, which parses the encoded message from an input stream, as part of a routine that parses an entire file.

void main( int argc, char *argv[ ] )
{
   parseEntireFile( "mimefile.txt" );
}
void parseEntireFile( char *szFilename )
{
   nsmail_inputstream_t *pInput;
   if ( file_inputstream_create( szFilename, &pInput ) == MIME_OK )
   {
   mime_message_t *pMessage;
/* Parse the MIME Message */
   if ( parseEntireMessageInputstream( pInput, &pMessage ) == MIME_OK )
   {
      showObject( pMessage, MIME_MESSAGE );
         mime_message_free( pMessage );
   }
   pInput -> close();
   nsStream_free (pInput);
   }
}
[Top]

Dynamic Parsing

This section describes the steps involved in using the dynamic parser. Dynamic parsing contrasts with standard MIME parsing, as described in Parsing the Entire Message, in several ways.

[Top]

Steps in Dynamic Parsing

Using the dynamic parser involves these operations:

All dynamic parser functions are defined in mimeparser.h.

[Top]

MIME Data Sink Callbacks

Callbacks operate in the same way in MIME as they do in other Messaging Access SDK protocols. However, for SMTP, IMAP4, and POP3, callbacks are tied to server responses to individual functions.

The dynamic parser data sink differs from the response sink in that, with a response sink, the mail application sends a command and gets a server response. In the data sink, when a callback takes place, the data is passed to the sink in callbacks. The callback is dependent upon the data in the input stream.

The MIME data sink contains one callback prototype for each piece of information that the parser can return. The dynamic parser makes callbacks based on the kind of data it finds in its input stream. For example, if the parser finds a header, the result is a header callback. As the parser encounters data, it returns information to the caller through callbacks in the data sink.

For general information about the data sink, response sinks, and callbacks, see SDK Response Sinks for C.

[Top]

Creating a Data Sink

The first step in dynamic parsing is to initialize the MIME data sink, which is defined by the mimeDataSink_t structure. The data sink is made up of function pointers and opaque data, which are set to null when the sink is initialized. For general information about the data sink, see SDK Response Sinks for C.

After creating the data sink, the application passes it to the parser. As the parser encounters information, it sends this on to the caller through callbacks in the data sink. The MIME data sink contains a call for each piece of information that the parser can return.

To initialize and allocate the data sink, call the mimeDataSink_new function and pass in the sink you want to use. If successful, this function returns NSMAIL_OK.

int mimeDataSink_new ( mimeDataSink_t **pp );
You can create parsers with different data sinks, based on what you want the messaging application to do. For example, you can define data sinks that create a brief header, a normal header, or list all header lines, each of which can be invoked with a different parser invocation. To add headers, define the ones your application requires within the data sink structure.

The following section of code creates the data sink and sets the sink function pointers.

/* Create the functions for the data sink */
void mimeDataSink_header( mimeDataSinkPtr_t pSink, 
                  void *pCallbackObject, char *name, char *value )
{ 
   sprintf( achTemp, "header() name = [%s]
                        value = [%s]\n", name, value );
   output( achTemp );
}
void mimeDataSink_contentType( mimeDataSinkPtr_t pSink, 
                  void *pCallbackObject, int nContentType )
{ 
   sprintf( achTemp, "contentType() = [%d]\n", nContentType );
   output( achTemp );
} 
   void mimeDataSink_contentSubType( mimeDataSinkPtr_t pSink,
                  void *pCallbackObject, char * contentSubType )
{ 
   sprintf( achTemp, "contentSubType() = [%s]\n", contentSubType );
output( achTemp ); 
}
void mimeDataSink_contentTypeParams( mimeDataSinkPtr_t pSink, 
                  void *pCallbackObject, char * contentTypeParams
)
{
   sprintf( achTemp, "contentTypeParams() = [%s]\n",
                  contentTypeParams ); output( achTemp );
}
void mimeDataSink_contentID( mimeDataSinkPtr_t pSink, 
                  void *pCallbackObject, char *contentID )
{ 
   sprintf( achTemp, "contentID() = [%s]\n", contentID );
   output( achTemp );
}
/* Create the data sink */
   mimeDataSink_new (&pDataSink ); 
/* Add the functions to the data sink */
   pDataSink->header = &mimeDataSink_header; 
   pDataSink->contentType = &mimeDataSink_contentType; 
   pDataSink->contentSubType = &mimeDataSink_contentSubType; 
   pDataSink->contentTypeParams = &mimeDataSink_contentTypeParams; 
   pDataSink->contentID = &mimeDataSink_contentID; 
/* Continue as required */
When a session is finished, you must free any memory associated with the data sink. Use this function:

void mimeDataSink_free( mimeDataSink_t **pp ); 
This function frees the data sink structure. The user must free any pointers to opaque data.

After you create the data sink, the next step is Creating the Dynamic Parser.

[Top] [Creating a Data Sink]

Creating the Dynamic Parser

After creating the data sink, the next step is to create a dynamic parser. You can use the mimeDynamicParser_new function to create a new parser and identify the data sink to use.

int mimeDynamicParser_new( mimeDataSink_t *pDataSink,
                           struct mimeParser **pp);
Supply the identifier for the data sink and the parser to use.

The following section of code creates a dynamic parser.

/* Initialize sink first, as described in Creating a Data Sink */
if ( mimeDynamicParser_new( pDataSink, &p) != MIME_OK )
When a session is finished, you must free any memory associated with the dynamic parser. Use this function:

void mimeDynamicParser_free( struct mimeParser **pp ); 
This function frees the dynamic parser structure and its data members.

After you create the dynamic parser, the next step is Running the Parser.

[Top]

Running the Parser

After the dynamic parser object has been created, as described in Creating the Dynamic Parser, parsing can begin. The application instructs the parser to continue the parsing operation until no more data is available, then signals that the parsing is complete.

To begin parsing, use this function:

int beginDynamicParse( struct mimeParser *p ); 
This function requires the identifier of the parser created with mimeDynamicParser_new.

To continue parsing, use the function that is appropriate for the data source, either an input stream or a data buffer. Continue to call this function until there is no more data left.

Use this function to parse data from an input stream:

int dynamicParseInputstream( struct mimeParser *p, 
                     struct nsmail_inputstream_t *pInput );
This function requires the identifier of the parser and the input stream to use. For the SDK functions that create input and output streams, see Shared Functions.

Use this function to parse data from a data buffer.

int dynamicParse( struct mimeParser *p, char *pData, int nLen ); 
This function requires the identifier of the parser in use, the data buffer to use, and the length of the data to parse.

When no more data remains to be parsed, call this function to indicate that parsing is complete:

int endDynamicParse( struct mimeParser *p ); 
The parser ends the operation.

To initiate another parsing cycle, you can call beginDynamicParse again.

The following section of code creates a dynamic parser, parses data from an input stream, and ends the parse operation.

/* Create the dynamic parser; see Creating the Dynamic Parser */
( mimeDynamicParser_new( pDataSink, &p );
   ( file_inputstream_create( szFilename, &pInput );
/* Start dynamic parsing */
      beginDynamicParse( p );
      for ( len = pInput->read( pInput->rock, buffer, BUFFER_SIZE2 );
         len > 0;
         len = pInput->read( pInput->rock, buffer, BUFFER_SIZE2 ) )
/* Continue dynamic parsing until no more data remains */
   {
   if ( dynamicParse( p, buffer, len ) != MIME_OK )
          break;
   }
/* When data is finished, stop the dynamic parser */
endDynamicParse(p);
/* Free the data sink used by the parser */
/* See
Creating a Data Sink */
   {
      mimeDataSink_free( &pDataSink );
   }
[Top]

MIME Functions by Task

To help you find the information you need more quickly, look for the task you want to perform in the column on the left. Then you can click the function name for further information.

Task Function for the task

Start dynamic parsing.

beginDynamicParse

Dynamically parse chunks of data from a data buffer.

dynamicParse

Dynamically parse chunks of data from an input stream.

dynamicParseInputstream

Signal the end of dynamic parsing.

endDynamicParse

Return the MIME type information for the specified file, based on file extension.

getFileMIMEType

Delete the message body data.

mime_basicPart_deleteData 

Free the basic part including all internal structures.

mime_basicPart_free_all

Return the decoded body-data in a buffer.

mime_basicPart_getDataBuf

Return the decoded body-data in an input stream.

mime_basicPart_getDataStream

Return the size of the body-data in bytes.

mime_basicPart_getSize

Write the byte stream for this part with MIME headers and encoded body-data.

mime_basicPart_putByteStream

Set the body-data for this part from a buffer.

mime_basicPart_setDataBuf

Set the body-data for this part from an input stream.

mime_basicPart_setDataStream

Free a MIME data sink.

mimeDataSink_free

Create a new data sink.

mimeDataSink_new

Decode a Base64-encoded data and write it to an output stream.

mime_decodeBase64

Decode and return a header string.

mime_decodeHeaderString

Decode Quoted Printable-encoded data and write it to an output stream.

mime_decodeQP

Free the dynamic parser.

mimeDynamicParser_free

Create the data sink for the dynamic parser.

mimeDynamicParser_new

Use Base64 encoding to encode message data.

mime_encodeBase64

Encode a header string.

mime_encodeHeaderString

Encode data using QP encoding.

mime_encodeQP

Free a MIME header.

mime_Header_new

Allocate memory for use with the MIME API.

mime_malloc

Free memory allocated by the SDK.

mime_memfree

Add a basic part as the body of the message.

mime_multiPart_addBasicPart

Add a basic part as the body of the message.

mime_message_addBasicPart

Add the message part as the body of the message.

mime_message_addMessagePart

Add the multipart as the body of the message.

mime_message_addMultiPart

Create a message given text-data and a file to attach.

mime_message_create

Delete the body part that makes up the body of this message.

mime_message_deleteBody

Free the message including all internal structures.

mime_message_free_all

Return the body part that makes up the body of the message.

mime_message_getBody

Return the content subtype of this message.

mime_message_getContentSubType

Return the content type of the body of this message.

mime_message_getContentType

Return the content_type parameters of this message.

mime_message_getContentTypeParams

Get the header value, given the header name.

mime_message_getHeader

Encode this part and write it to an output stream.

mime_message_putByteStream

Delete the MIME message that makes up the body of this part.

mime_messagePart_deleteMessage

Free the message-part including all internal structures.

mime_messagePart_free_all

Create a message part from a message structure.

mime_messagePart_fromMessage

Retrieve the message from the message part.

mime_messagePart_getMessage

Write the byte stream for this part with MIME headers and encoded body-data.

mime_messagePart_putByteStream

Set a message as the body of this message-part.

mime_messagePart_setMessage

Add a basic part to a multipart.

mime_multiPart_addBasicPart

Add a file as basic part to the multipart.

mime_multiPart_addFile

Add a message part to the multipart.

mime_multiPart_addMessagePart

Add a message part to the multipart.

mime_multiPart_addMultiPart

Delete the body part at the specified index from this multipart.

mime_multiPart_deletePart

Free the multipart including all internal structures.

mime_multiPart_free_all

Return the body part at the specified index.

mime_multiPart_getPart

Return the count of the body parts in this multipart.

mime_multiPart_getPartCount

Write the byte stream for this part with MIME headers and encoded body-data.

mime_multiPart_putByteStream

Parse an entire message from a data buffer.

parseEntireMessage

Parse an entire message from an input stream.

parseEntireMessageInputstream

[Top] [MIME Functions by Task]


Table of Contents | Previous | Next | Index

Last Updated: June 3, 1998

Copyright © 1998 Netscape Communications Corporation