Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > UIDCopyMsg Method
ContentsIndexHome
PreviousUpNext
TIdIMAP4.UIDCopyMsg Method

Copies a message from the current mailbox to a specified mailbox.

function UIDCopyMsg(
    const AMsgUID: String; 
    const AMBName: String
): Boolean;
Parameters 
Description 
AMsgUID 
Unique identifier for the message in the currently selected mailbox.
 
AMBName 
target mailbox name on the IMAP4 server. 

Boolean - True on success.

UIDCopyMsg is a Boolean function used to copy a message in the currently selected mailbox to another mailbox on the IMAP4 server. 

AMsgUID is the unique identifier for the message in the currently selected mailbox. 

AMBName is the target mailbox on the IMAP4 server where a copy of the message will be stored. AMBName must represent an existing mailbox on the IMAP4 server that is valid for the currently connected Username and Password

UIDCopyMsg performs validation for the value in AMsgUID, and can raise an EIdNumberInvalid exception if the message UID contains an invalid value for use as a unique identifier. 

Use of UIDCopyMsg requires that a mailbox be previously selected using the SelectMailbox method, and that ConnectionState contains the value csSelected, or an EIdConnectionStateError exception will be raised. 

UIDCopyMsg calls SendCmd to send the IMAP4 COPY command using the values indicated in AMsgUID and AMBName. AMBName is UTF7-encoded prior to transmission. 

The return value for the method is True on successful completion of the IMAP4 COPY command. 

Use UIDCopyMsgs to copy multiple message numbers to a specified mailbox. 

Use CopyMsg or UIDCopyMsg to copy a single message in the currently selected mailbox using a relative message number or a unique identifier.

Exceptions 
Description 
With the message RSIMAP4NumberInvalid
With the message RSIMAP4ConnectionStateError
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.