Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Each BodyPart object has an associated stream, different from its possible content stream, that is the body part serialized in MIME format. The stream is returned in an ADO Stream object exposing an ADO _Stream interface. The body part and all child body parts below in the MIME hierarchy are used to construct this stream. You can use this stream to copy body part hierarchies between different messages. For example, you could have built a complex MIME hierarchy and you could copy the entire hierarchy from one message to another. An easy way to do this would be to retrieve the stream for the root body part in your hierarchy and copy it into the stream of a body part in the other object. When saved, the Message object parses the body part content and subsequently generates the BodyPart object hierarchy.
To clarify the difference between a body part's content stream and its stream, consider the following code example: the stream for a body part containing the HTML portion of a message could look like:
Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <html><p>Here is a simple <b>message</b>.
The content stream for the body part would simply be:
<html><p>Here is a simple <b>message</b>.
Another example is a multipart/mixed body part stream returned using the IBodyPart.GetStream method, not using GetEncodedContentStream. (multipart body parts does not have a content stream.)
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01BED789.F54D7C60" This is a multi-part message in MIME format. ------=_NextPart_000_0000_01BED789.F54D7C60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Here is a simple message. ------=_NextPart_000_0000_01BED789.F54D7C60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <html><p>Here is a simple <b>message</b>. ------=_NextPart_000_0000_01BED789.F54D7C60--