Using Win32 functions in Visual FoxPro Image Gallery
Simple MAPI
..msdn
MAPIAddress
MAPIFindNext
MAPIFreeBuffer
MAPILogoff
MAPILogon
MAPIReadMail
MAPIResolveName
MAPISendDocuments
MAPISendMail
Code examples:
How to read email messages using Simple MAPI
MAPIReadMail
..msdn    Add comment     W32 Constants      Translate this page
The MAPIReadMail function retrieves a message for reading.
Code examples:
How to read email messages using Simple MAPI
Declaration:
ULONG FAR PASCAL MAPIReadMail(
  LHANDLE lhSession,
  ULONG ulUIParam,
  LPTSTR lpszMessageID,
  FLAGS flFlags,
  ULONG ulReserved,
  lpMapiMessage FAR * lppMessage
)
FoxPro declaration:
DECLARE INTEGER MAPIReadMail IN mapi32;
    INTEGER   lhSession,;
    INTEGER   ulUIParam,;
    STRING    lpszMessageID,;
    INTEGER   flFlags,;
    INTEGER   ulReserved,;
    INTEGER @ lppMessage
Parameters:
lhSession
[in] Handle to a Simple MAPI session.

ulUIParam
[in] Parent window handle or zero, indicating that if a dialog box is displayed, it is application modal.

lpszMessageID
[in] Pointer to a message identifier string for the message to be read.

flFlags
[in] Bitmask of option flags.

ulReserved
Reserved; must be zero.

lppMessage
[out] Pointer to the location where the message is written.
Return value:
SUCCESS_SUCCESS (0) or an error code.
Usage:
LOCAL lnResult, lnMemPtr
lnMemPtr = 0

lnResult = MAPIReadMail(hSession, 0, lcMsgId,;
    MAPI_PEEK+MAPI_SUPPRESS_ATTACH, 0,;
    @lnMemPtr)

IF lnResult = SUCCESS_SUCCESS
    * process the message specified by the pointer
    * ...
    = MAPIFreeBuffer(lnMemPtr)
ENDIF

My comment:
Before calling MAPIReadMail, use the MAPIFindNext function to verify that the message to be read is the one you want to be read.

Messages are written to a MapiMessage structure which can be freed with a single call to the MAPIFreeBuffer function.
Word Index links for the MAPIReadMail :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2002-01-29 20:41:16
Modified: 2007-06-11 22:12:57
Visited in last 7 days: 28
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.221.73.186)
17 sec.Function: 'GetParent'
33 sec.Function: 'LoadLibrary'
49 sec.Function: 'GdipGetDpiX'
1.1 min.Function: 'GetClipboardViewer'
1.33 min.Function: 'SQLCreateDataSource'
1.6 min.Function: 'AVIStreamInfo'
1.9 min.Function: 'OpenEvent'
2.17 min.Function: 'CreateEnhMetaFile'
2.43 min.Function: 'CommandLineToArgvW'
2.7 min.Function: 'SetJob'
Google
Advertise here!