CopyMessage Method  

Copy a message from the current mailbox to another mailbox.


object.CopyMessage( MessageNumber, MailboxName, [Options] )


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.
A 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.
An optional parameter reserved for future use. This argument should either be omitted, or always be zero.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure.


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. If the mailbox does not exist, the function 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.

See Also

CreateMailbox Method, CreateMessage Method, GetMessage Method