Platform SDK: Exchange 2000 Server

HTMLBody Property

[This is preliminary documentation and subject to change.]

The HTML representation of the message.

[Visual Basic]
Property HTMLBody as String
[C++]
HRESULT get_HTMLBody(BSTR* pVal);
HRESULT put_HTMLBody(BSTR Val);
[IDL]
HRESULT [propget] HTMLBody([out,retval] BSTR* pVal);
HRESULT [propput] HTMLBody([in] BSTR Val);

Remarks

This property is also available as the urn:schemas:httpmail:htmldescription entry in the schema.

To construct a MIME message containing both the plain text and HTML versions of the body, you can set the message's ContentMediaType property on the IBodyPart interface to "multipart/alternative", the first body part's ContentMediaType to "text/plain", and the second body part's ContentMediaType to "text/richtext" or "text/html". Alternatively, you can use the AutoGenerateTextBody and MimeFormatted properties to automate some of this process. When these properties are both True and you set HTMLBody, CDO automatically sets the TextBody property to the plain text equivalent.

If you set MimeFormatted to False, the HTMLBody property is removed from the message and the HTML text is lost.

To access the corresponding plain text string, use the TextBody property.

You can access the BodyPart object containing the HTML for the message using the IMessage.HTMLBodyPart property.

The HTMLBody property returns an empty string if it has never been set. If you need to determine whether this is the case or whether the HTML text is present but currently an empty string, use the IMessage.HTMLBodyPart method to access the BodyPart object containing the HTML for the message.

The default value of HTMLBody is an empty string.

See Also

urn:schemas:mailheader:htmldescription Field

IMessage.HTMLBodyPart Property