Example: imap_copy

In the following example, the imap_copy function copies several messages from the current mailbox. It copies messages 2 through 4 to the Meeting mailbox, and message 10 to the Archived mailbox.

    imap_copy("CopyToFolders",
       "Message=2:4", "ToMailbox=Meeting", ENDITEM,
       "Message=10", "ToMailbox=Archived", ENDITEM,
       LAST );