Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.CopyMsgs
Copies messages to the specified mailbox.

function CopyMsgs(const AMsgNumList: array of Integer; const AMBName: String): Boolean; overload;
Parameters
const AMsgNumList: array of Integer
Message numbers to copy to the destination mailbox.

const AMBName: String
Mailbox name to receive a copy of the selected messages.

Returns
Boolean - True on success.

Description
CopyMsgs is an overloaded Boolean function in TIdIMAP4 that copies messages specified by AMsgNumList from the currently selected mailbox to the mailbox specified in AMBName.

If AMsgNumList is an empty array (length of zero), CopyMsg sets the return value to False and exits the method. CopyMsg requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised.

CopyMsg calls the SendCmd method using the IMAP COPY command, and sets the return value to True when the response in ResultNo contains wsOk.