TransportCheckForNewMail

This function searches a mail server for new mail.

At a Glance

Header file: Msgstor2.h
Platforms: H/PC 3.0
Windows CE versions: 2.10 and later

Syntax

BOOL TransportCheckForNewMail( HANDLE hService,
CHECKFORNEWMAILCALLBACK
pfnCheckNewMailCallback);

Parameters

hService
[in] Handle to a private SERVICE structure.
pfnCheckNewMailCallback
[in] Pointer to a callback function of the following prototype:

BOOL _cdecl CheckNewMailCallback (lpTransportCheckForNewMailInfo *pInfo)

Return Values

TRUE indicates the function has successfully initiated the callback function on the server. FALSE indicates failure. To get extended error information, call the function TransportError or TransportErrorMsg.

Remarks

The transport service provider must implement this function in a DLL registered as a mail service. The Inbox application can then load this DLL and call this function.

When checking for new mail, call the function CheckNewMailCallback twice. First, use the callback function to obtain the list of folders to search for new messages. Signal this by setting the fFree parameter of the pInfo structure to FALSE. After checking for new messages, signal the callback function to release the storage used by the TransportFolderList structure by setting fFree to TRUE. When releasing storage, ignore szFriendlyName members in the TransportFolderInfo structures in TransportFolderList.