wodImapServer ActiveX Component - ListMessages Event
    
 

Description

Fires when user lists messages.


Syntax

Private Sub object_ListMessages(User, Folder)



The ListMessages Event syntax has these parts:

Part Description
object A wodImapServer object.
User An ImapUser object. Reference to user who wants to read messages.
Folder An ImapFolder object. Reference to folder from where messages are listed.

Remarks
Once user opens specific folder and wants to see what are available messages, ListMessages event is fired. At this point you should load all messages using Messages.Add method. You can keep your messages wherever you want - but internally wodImapServer will access them as files on disk. So, you can point Message.Filename property to the file where message body is stored (in EML format, just like Outlook Express or UNIX messages), or you can use Message.Body property and put message body contents directly into the message.

You will notice that ListMessage is fired more than once. Each time user actually tries to access specific Folder, wodImapServer will fire this event. Usually - you can just ignore it, but if folder contents is changed (either by user's actions, or external source) you might want to update contents - for example, to delete messages, add new ones etc.

Don't forget - immediately after you add new message to current Folder, you should also set its UID and Flags!