Zarafa specific text functions — This section describes special functions used to handle texts of a mailbody.
string mapi_decompressrtf(string $compressedRTF);
string mapi_rtf2html(string $RTF);
string mapi_html2rtf(string $HTML);
string mapi_compressrtf(string $uncompressedRTF);
>string mapi_decompressrtf(string $compressedRTF)
Decompresses a compressed RTF stream from the PR_RTF_COMPRESSED property.
This function will decompress the RTF Body from a message and return the decompressed RTF.
Example 3.83. Decompress a RTF body
$rtf = mapi_openproperty($inbox, PR_RTF_COMPRESSED); echo mapi_decompressrtf($rtf); // will echo the raw rtf data
string mapi_rtf2html(string $RTF)
Decodes the raw RTF data to readable HTML.
This function will read the embedded HTML from an RTF stream. When the RTF Stream is not of the embedded HTML RTF type the function will return false indicating that the body must be read as plaintext.
Example 3.84. Decoding RTF
$rtf = mapi_openproperty($inbox, PR_RTF_COMPRESSED); echo mapi_rtf2html(mapi_decompressrtf($rtf)); // will echo the html data.
string mapi_html2rtf(string $HTML)
Encodes the HTML as RTF.
This function encodes the given HTML into an RTF document, which can subsequently be passed to mapi_compressrtf to be included in MAPI messages. The HTML is encoded so that when it is decoded, the exact HTML source is again readable.
Compresses an uncompressed RTF stream for the PR_RTF_COMPRESSED property.
This function will compress the RTF Body for a message and return the compressed RTF.
string mapi_compressrtf(string $uncompressedRTF);
Example 3.86. Compress an RTF body
$rtf = mapi_openproperty($inbox, PR_RTF_COMPRESSED); $decompressedRTF = mapi_decompressrtf($rtf); // will echo the raw rtf data, uncompressed echo $decompressedRTF; // will echo compressed RTF data, usable for streaming (back) to PR_RTF_COMPRESSED echo mapi_compressrtf($decompressedRTF);