ImapDisconnect Function  
 
INT WINAPI ImapDisconnect(
  HCLIENT hClient  
);

The ImapDisconnect function terminates the connection with the server, releasing the memory allocated for the client session.

Parameters

hClient
Handle to the client session.

Return Value

If the function succeeds, the return value is zero. If the function fails, the return value is IMAP_ERROR. To get extended error information, call ImapGetLastError.

Remarks

If a mailbox is selected at the time that ImapDisconnect is called, the current mailbox will be unselected and any messages that are marked for deletion will be expunged. To prevent any deleted messages from being removed from the mailbox, use the ImapUnselectMailbox function to unselect the current mailbox prior to disconnecting from the server.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csmapav7.lib.

See Also

ImapAsyncConnect, ImapConnect, ImapUninitialize, ImapUnselectMailbox