ImapCopyMessage Function  
 
INT WINAPI ImapCopyMessage(
  HCLIENT hClient,  
  UINT nMessageId,  
  LPCTSTR lpszMailbox  
);

The ImapCopyMessage function copies a message from the current mailbox to the specified mailbox. The message is appended to the mailbox, and the message flags and internal date are preserved.

Parameters

hClient
Handle to the client session.
nMessageId
The message identifier which specifies which message is to be copied to the mailbox. This value must be greater than zero and specify a valid message number.
lpszMailbox
A pointer to a null-terminated string which specifies the name of the mailbox that the message will be copied to. The mailbox must already exist, and the client must have the appropriate access rights to modify the mailbox.

Return Value

If the function succeeds, it returns a value of zero. If an error occurs, the function returns IMAP_ERROR. To get extended error information, call ImapGetLastError.

Remarks

If the mailbox does not exist, the function will fail. To create a new mailbox, use the ImapCreateMailbox function. A message can be copied within the same mailbox, in which case the server may flag it as a new message.

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.
Unicode: Implemented as Unicode and ANSI versions.

See Also

ImapCreateMailbox, ImapGetResultCode, ImapGetResultString