wodImapServer ActiveX Component - CopyMessage Method
      
 

Description

Called when user wants to copy message to other folder.


Return Type

None  


Syntax

object.CopyMessage Owner, User, Folder, Message, Destination, Action



The CopyMessage Method syntax has these parts:

Part Description
object An expression evaluating to an object of type IwodImapNotify.
Owner Required. A wodImapServer object.
User Required. An ImapUser object. Reference to user who wants to copy message.
Folder Required. An ImapFolder object. Reference to folder where message originates.
Message Required. An ImapMessage object. Reference to message that should be copied.
Destination Required. An ImapFolder object. Reference to destination folder.
Action Required. An ImapActions enumeration, as described in settings. Return value you should fill with either Allow or Deny value, depending if you will allow user to copy message or not.

Settings

The settings for Action are:

Constant Value Description
 Deny 0 Deny execution of the action.
 Allow 1 Allow to execute action.

Remarks
NOTE: This method is called only if you implemented IwodImapNotify interface in your application, and wodImapServer1.Notification property has received reference to instance of your implementation.
 
CopyMessage notification method is called when user wants to copy message from one folder to another. Typical example is (on some clients) when he copies message to Trash folder (and then deletes original).

When message is copied to destination folder, it should preserve message flags, but it should get new UID. To set proper UID, wodImapServer will internally use Folder.NextMessageUID property so you don't have to change it manually - unless you want to.

Since message contents cannot be changed with wodImapServer, you can freely just reference same file in Message.Filename property. But beware - when message is deleted you shouldn't delete referenced file if there are more (copied) messages pointing to it.