Platform SDK: CDO for Windows 2000

ContentTransferEncoding Property

The ContentTransferEncoding property defines the encoding mechanism used when sending the contents of an implementing object over the network.

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

Remarks

The ContentTransferEncoding property corresponds to the Content-Transfer-Encoding Multipurpose Internet Mail Extensions (MIME) header field of Request for Comments (RFC) 2045.

This property corresponds to the urn:schemas:mailheader:content-transfer-encoding field for the object. You can therefore set this field using the ContentTransferEncoding property on the interface or by updating the value using the Fields collection.

Microsoft Collaboration Data Objects (CDO) defines the following string constants and mechanisms for use with the ContentTransferEncoding property:

CdoEncodingType Module Constants

Constant Value Meaning
cdo7bit "7bit" Simple 7-bit ASCII
cdo8bit "8bit" 8-bit coding with line termination characters
cdoBase64 "base64" 3 octets encoded into 4 sextets with offset
cdoBinary "binary" Arbitrary binary stream
cdoMacBinHex40 "mac-binhex40" Macintosh binary to hex encoding
cdoQuotedPrintable "quoted-printable" Mostly 7-bit, with 8-bit characters encoded as "=HH"
cdoUuencode "uuencode" UNIX Uuencode encoding

In compliance with RFC 2045, the ContentTransferEncoding property is enforced to be "7bit", "8bit", or "binary" when the ContentMediaType property indicates a composite content type such as message or multipart. An attempt to encode a composite type with any other mechanism results in an error.

CDO can decode a body part from "mac-binhex40" but cannot encode using this mechanism.

The contents of ContentTransferEncoding are case-insensitive. The default value is "7bit".

Example

Dim iBp as CDO.IBodyPart
iBp.ContentTransferEncoding = "base64"