IMimeSecurity::EncodeBody method

Encodes the specified message body using Secure/Multipurpose Internet Mail Extensions (S/MIME).

Syntax

HRESULT EncodeBody(
  [in] IMimeMessageTree pTree,
  [in] HBODY            hEncodeRoot,
  [in] DWORD            dwFlags
);

Parameters

pTree [in]

Type: IMimeMessageTree

Specifies a pointer to the IMimeMessageTree object that contains the body to encode.

hEncodeRoot [in]

Type: HBODY

Specifies the handle of the body to encode.

dwFlags [in]

Type: DWORD

Specifies a set of encode body flags (EBF_*) or security encoding flags (SEF_*). Do not overlap EBF_* and SEF_* flags.

EBF_RECURSE (0x00010000)

EBF_COMMITIFDIRTY (0x00020000)

EBF_MASK (0xffff0000)

SEF_ENCRYPTWITHNOSENDERCERT (0x00000001)

SEF_SENDERSCERTPROVIDED (0x00000002)

SEF_NOUI (0x00000004)

SEF_MASK (0x0000ffff)

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Indicates success.
E_FAIL
Indicates that an unknown error has occurred.
E_INVALIDARG
Indicates that pTree or hEncodeRoot is NULL.
MIME_S_SECURITY_NOOP
Indicates that the body is not encoded.
MIME_E_SECURITY_CLASSNOTSUPPORTED
Indicates that the message is an unsupported S/MIME class.
MIME_E_SECURITY_NOCERT
Indicates that no certificates were found.
E_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
MIME_E_SECURITY_ENCRYPTNOSENDERCERT
Indicates that the body is already encoded with an unknown certificate.

Remarks

S/MIME is the secure version of MIME.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Mimeole.h
IDL
Mimeole.idl
DLL
Inetcomm.dll (version 6.0 or later)