IMimeMessage::GetTextBody method

Gets the text body for the message.

Syntax

HRESULT GetTextBody(
  [in]  DWORD        dwTxtType,
  [in]  ENCODINGTYPE ietEncoding,
  [out] IStream      **ppStream,
  [out] LPHBODY      phBody
);

Parameters

dwTxtType [in]

Type: DWORD

Specifies the type of text body to retrieve.

Value Meaning
TXT_PLAIN
0x00000001
Content-Type is text/plain.
TXT_HTML
0x00000002
Content-Type is text/html.

ietEncoding [in]

Type: ENCODINGTYPE

Specifies an ENCODINGTYPE value that indicates how the data in ppStream should be encoded. Either IET_DECODED, IET_BINARY, or IET_UNICODE is a typical value for this parameter.

ppStream [out]

Type: IStream**

Receives an address to a pointer to the IStream object that contains the text body. The client is responsible for releasing this object.

phBody [out]

Type: LPHBODY

Receives the handle of the text body that was found.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Indicates success.
E_FAIL
Indicates that an unknown error has occurred.
E_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
MIME_E_INVALID_TEXT_TYPE
Indicates that the value specified by dwTxtType is not valid.
MIME_E_NOT_FOUND
Indicates that the message does not have a text body.
MIME_E_NO_DATA
Indicates that the text body that was found does not contain any data.

Remarks

Typically, if a client supports HTML, the client would request TXT_HTML first. If that fails, then it would request TXT_PLAIN.

This method excludes bodies that are marked as attachments. The text body is usually what a client requests to display the body of a message to the user. MimeOLE treats a text/enriched type body as text/html and converts it to valid HTML.

For a MIME Encapsulation of Aggregate HTML Documents (MHTML) message, MimeOLE uses the start parameter that is associated with multipart/related bodies to locate the correct text body.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Mimeole.h
IDL
Mimeole.idl
DLL
Inetcomm.dll (version 6.0 or later)