Share via


ContentTransferEncoding Property

Topic Last Modified: 2006-06-13

Defines the encoding mechanism used when sending an implementing object's contents over the network.

Applies To

IBodyPart Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Property ContentTransferEncoding As String
HRESULT get_ContentTransferEncoding(BSTR* pVal);HRESULT put_ContentTransferEncoding(BSTR Val);

Parameters

  • pVal
    Returns the value of the ContentTransferEncoding property as a reference to a BSTR.
  • Val
    Sets the value of the ContentTransferEncoding property to the value of the BSTR.

Remarks

The ContentTransferEncoding property corresponds to the Content-Transfer-Encoding Multipurpose Internet Mail Extensions (MIME) header field of 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

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"

UUENCODE encoding.

In compliance with RFC 2045, the ContentTransferEncoding property is enforced to be "7bit", "8bit", or "binary" when ContentMediaType 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 not case-sensitive. The default value is "7bit".

Example

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