wodImapServer ActiveX Component - CreateMessage Method
      
 

Description

Called when user wants to create new message.


Return Type

None  


Syntax

object.CreateMessage Owner, User, Folder, Message, Action



The CreateMessage 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 create new message.
Folder Required. An ImapFolder object. Reference to folder where new message should be created.
Message Required. An ImapMessage object. Reference to new pre-created message.
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 message to be created 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.

 

This notification method does not apply nor is called when you Add messages to the folder. It is called only when user actions lead to necessity of creating new message. Typical reason for this could be when user wants to copy some message from external source to your IMAP server. For example, Outlook express allows users to drag EML files to specific folder and drop it there - in which case you should create new message and user will paste contents to it.

Before this notification method is called, wodImapServer will create new message and give you reference to it through Message parameter. If you Deny this Action, then it will be removed from the collection immediately after you exit this event.

But - if you decide to allow message to be created, you should check if proper Message.UID is set, set Message.Filename and set proper Flags (or just remove all flags). Later on, when wodImapServer wants to write actual body to this message, it will call WriteMessage notification method informing you to update message contents on your storage device. If you already put valid Filename for the message - you can just ignore WriteMessage notification.