MAPIDeleteMail function

[The use of this function is discouraged. It may be altered or unavailable in subsequent versions of Windows.]

The MAPIDeleteMail function deletes a message.

Syntax


ULONG WINAPI MAPIDeleteMail(
  _In_  LHANDLE lhSession,
  _In_  ULONG_PTR ulUIParam,
  _In_  LPSTR lpszMessageID,
  FLAGS flFlags,
  ULONG ulReserved
);

Parameters

lhSession [in]

Session handle that represents a valid Simple MAPI session. The value of the lhSession parameter must represent a valid session; it cannot be zero.

ulUIParam [in]

Parent window handle or zero, indicating that if a dialog box is displayed, it is application modal. If the ulUIParam parameter contains a parent window handle, it is of type HWND (cast to a ULONG_PTR). If no dialog box is displayed during the call, ulUIParam is ignored.

lpszMessageID [in]

The identifier for the message to be deleted. This identifier is messaging system-specific and will be invalid when MAPIDeleteMail successfully returns.

flFlags

Reserved; must be zero.

ulReserved

Reserved; must be zero.

Return value

This function returns one of the following values.

Return codeDescription
MAPI_E_FAILURE

One or more unspecified errors occurred while deleting the message. No message was deleted.

MAPI_E_INSUFFICIENT_MEMORY

There was insufficient memory to proceed. No message was deleted.

MAPI_E_INVALID_MESSAGE

An invalid message identifier was passed in the lpszMessageID parameter. No message was deleted.

MAPI_E_INVALID_SESSION

An invalid session handle was passed in the lhSession parameter. No message was deleted.

SUCCESS_SUCCESS

The call succeeded and the message was deleted.

 

Requirements

Header

Mapi.h

DLL

Mapi32.dll

See also

Simple MAPI
MAPIFindNext
MAPILogon
MAPISaveMail

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.