Name

Messages — Reading messages.

Messages

The reading of the contents from a message can be done in a generic way. All messages contain all types of bodies. The different body types are kept in sync automatically, and the version which is written last wins, and updates the other versions. The following body types are available:

There are 3 ways in which the body of a message can be stored:

RTF

The content of the message is stored in the PR_RTF_COMPRESSED property.

Embedded HTML in RTF

The content of the message is stored in the PR_RTF_COMPRESSED property. This is a special type of RTF that has an embedded HTML content. This version has been depricated by normal HTML.

HTML text

The content of the message is stored in the PR_HTML property. This is normal HTML formatted text.

Plain text

The content of the body is stored in the PR_BODY property, and only contains the plain text.

The PR_RTF_COMPRESSED property can hold RTF of HTML embedded text. If you use this property, you can convert it to HTML with the mapi_rtf2html function. Therefore, this property is only usefull to detect if the original message was sent in TRF or HTML.

RTF

The RTF-text may be used when messages are stored within Outlook. RTF text can only be sent through the TNEF data in a winmail.dat attachment.

Embedded HTML in RTF

The messages that are sent in HTML will be stored as RTF in the PR_RTF_COMPRESSED property. The HTML is converted from plain HTML to Embedded HTML. With the function mapi_rtf2html this type of RTF can be converted back to HTML to be shown in a browser. The function will return false when the RTF is not of the correct type.

While this is still true, this method of reading the body is depricated. If you want the HTML version of the body, use the normal HTML property.

HTML text

The normal HTML property is stored in the PR_HTML property. This is the preferred property if you want to read the HTML body.

Plain text

The PR_BODY will contain the message body in Plain text.