Call the MAPILogoff function to close a session when it is no longer needed.
Call the MAPIFreeBuffer function to release any buffers that were allocated by Simple MAPI calls and returned to your client for its use. Calling MAPILogoff does not cause buffers allocated by Simple MAPI calls to be released. Your client has that responsibility.