MIME Component

The MIME control allows for easy implementation of the Multipurpose Internet Mail Extensions or MIME as defined in RFC 1521 and updated in RFCs 2045-2049. Those standards provide for formating of messages containing non-text, multipart or non 'US' formated text.

(NOTE: The following is a very short description. For more information, please consult the help files that come with the respective package.)


The control's operation is controlled by the Action property. It may be used for decoding or encoding of messages. Message holds the content of the encoded message or the filename which holds the encoded data. The decoded data is put in PartDecodedString and/or PartDecodedFile depending on the user's query.

To decode a MIME message you should first assign either the whole message (headers and body) to Message or put the message headers to MessageHeaders and the message body or the filename holding it to Message. Setting Action property to decode directs the control to start parsing the message: it will fill out the ContentType, ContentTypeAttr and PartCount properties as well as the array properties PartSize, PartContentType, PartContentTypeAttr, PartContentDisposition, PartContentDispositionAttr, PartEncoding, PartName, PartFilename, PartHeaders, for each decoded part from 0 to PartCount-1.

For each part you may then get the content out of PartDecodedString or PartDecodedFile properties. Setting Action to decode doesn't actually decode the message but only parses it. The real decoding is done when the respective array property PartDecodedFile or PartDecodedString is first accessed for any particular index.

To encode data into a MIME message you should first assign values for each part to either PartDecodedString or PartDecodedFile, optionally assign values to the other Part- properties. Assiging a value to the PartDecodedString or PartDecodedFile properties fills out automatically the PartHeaders property for the respective part. Set Action property to encode directs the control to fill out the Message with the message body and the MessageHeaders with the headers.

The Progress event is fired as the message is parsed and the data is decoded/encoded.


   PROPERTIES

Action. Controls the operation of MIME control.

Boundary. The boundary separating the MIME parts. Maximum length of 80.

ContentType. The value of the content-type header of the message which was encoded/decoded.

ContentTypeAttr. The attributes for content-type header of the message which was encoded/decoded.

Message. Filename holding the encoded message or the encoded message itself.

MessageHeaders. The headers of the MIME message.

PartContentType. Content type for each part 0 to PartCount-1.

PartContentTypeAttr. Array holding the content type attributes, if any, for each part, numbered 0 to PartCount-1.

PartContentDisposition. Content Disposition for each part 0 to PartCount-1.

PartContentDispositionAttr. Array holding the content disposition's attributes, if any, for each part, numbered 0 to PartCount-1.

PartEncoding. The actual content encoding type for each part 0 to PartCount-1.

PartDecodedFile. Array holding the filenames with the decoded data numbered 0 to PartCount-1.

PartDecodedString. Array property. It holds the actual content of each part, numbered 0 to PartCount-1.

PartFilename. The filename attribute specified in the headers of the part.

PartName. The name given to a part, such as the filename.

PartHeaders. Headers for each MIME part, numbered 0 to PartCount-1.

PartSize. The size of each PartDecodedFile or PartDecodedString.

PartCount. The number of MIME parts in the encoded message.

   EVENTS

Progress. Shows the progress of decoding/encoding the input data.


© 1999 devSoft Inc. - All Rights Reserved.
devSoft Inc.,  P.O.Box 13821 , Research Triangle Park, NC 27709 , USA,