CImapClient::CopyMessage Method  
 
INT CopyMessage(
  UINT nMessageId,  
  LPCTSTR lpszMailbox  
);

The CopyMessage method 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

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 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 method succeeds, it returns a value of zero. If an error occurs, the method returns IMAP_ERROR. To get extended error information, call GetLastError.

Remarks

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

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csmapv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also