4D Internet Commands v14

IMAP_CopyToMB

Home

 
4D Internet Commands v14
IMAP_CopyToMB

IMAP_CopyToMB 


 

IMAP_CopyToMB ( imap_ID ; startMsg ; endMsg ; mbNameTarget ; msgDelete ) -> Function result 
Parameter Type   Description
imap_ID  Longint in Reference to an IMAP login
startMsg  Longint in Start message number
endMsg  Longint in End message number
mbNameTarget  Text in Name of the destination mailbox
msgDelete  Integer in 0= Do not remove from source mailbox, 1= Remove from source mailbox
Function result  Integer in Error code

Given a range of messages from startMsg to endMsg, the IMAP_CopyToMB command will copy the specified message(s) to the end of the specified mbNameTarget destination mailbox. The flags and the internal date of the message(s) are usually preserved in the destination mailbox, depending on the IMAP server implementation.

After being copied, original messages are not removed from the source mailbox. If you want to remove them, you can use one of the 3 following processes:

Note: The msgDelete parameter will force the execution of an IMAP_Delete; therefore, the deletion will include messages between startMsg and endMsg and ALL messages for which the \Deleted flag is set.

If the destination mailbox does not exist, an error is returned.

imap_ID is a long integer reference to an open connection created with IMAP_Login.

startMsg is a long integer number that specifies the starting message number of the message range to be copied. The message number is a value representing the position of a message within the list of all messages in the mailbox identified by imap_ID.

endMsg is a long integer number that specifies the ending message number of the message range to be copied. The message number is a value representing the position of a message within the list of all messages in the mailbox identified by imap_ID.

Note: The IMAP_Delete, IMAP_MsgLstInfo, IMAP_MsgLst, IMAP_SetFlags, IMAP_GetFlags and IMAP_CopyToMB commands do not return an error if the startMsg is greater than the endMsg. In the event that this occurs, the command – in effect – does nothing.

mbNameTarget is the full name of the mailbox where the specified messages will be copied.

The msgDelete optional parameter allows setting if you want to remove the message from the source mailbox.
• 0= Do not remove from source mailbox (default value);
• 1= Remove from source mailbox.

If msgDelete is omitted, the default value is used.

If copying fails, the message is not removed from the source mailbox.

If the user does not have access to remove messages, an error message is generated.

 
PROPERTIES 

Product: 4D Internet Commands
Theme: IC IMAP Review Mail
Number: 88863

 
HISTORY 

Created: 4D Internet Commands 6.8.1

 
SEE ALSO 

IMAP_CreateMB
IMAP_ListMBs
IMAP_RenameMB

 
ARTICLE USAGE

4D Internet Commands ( 4D Internet Commands v11.4)
4D Internet Commands ( 4D v13.2)
4D Internet Commands ( 4D Internet Commands v12.1)
4D Internet Commands ( 4D Internet Commands v14 R2)
4D Internet Commands ( 4D Internet Commands v14)
4D Internet Commands ( 4D Internet Commands v14 R3)
4D Internet Commands ( 4D Internet Commands v14 R4)