SocketTools .NET Edition

ImapClient.CopyMessage Method 

Copy a message from the current mailbox to another mailbox.

[Visual Basic]
Public Function CopyMessage( _
   ByVal messageId As Integer, _
   ByVal mailboxName As String _
) As Boolean
[C#]
public bool CopyMessage(
   int messageId,
   string mailboxName
);

Parameters

messageId
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.
mailboxName
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.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

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

ImapClient Class | SocketTools Namespace