|
See the section entitled "Using Distinct ActiveX controls in various environments" on how to add the control to your project.
After placing a IMAP ActiveX control into a form, some properties can be set at design time. However, the application may want to request information from the user at runtime before setting the
properties. There are also properties that are used by the IMAP ActiveX control to deliver requested information about a mailbox or message and should not be set by the application. The topic for
each property explains how and when it should be used.
The Distinct IMAP ActiveX control supports four states, the non-authenticated state, authenticated state, selected state and the logout state. Each of the IMAP methods is valid in a certain state,
the method will fail if it is called in an inappropriate state. The non-authenticated state is the state where the connection with the IMAP server has been established with the call Connect or
FwConnect method. The Capability, Direct, Noop and Disconnect methods are the only valid methods in this state. Any method that is valid for a lower state is automatically valid for any higher
states. I.e. Noop is valid in the non-authenicated state and can therefore be used in any higher state also.
The application should call the Login method to get from the non-authenticated to the authenticated state. Only the User/Password authentication mechanism is supported. The Append, Examine, Select,
Delete, Rename, Create, Subscribe, Unsubscribe, Status, List, and ListSubscribed methods are valid in this state. In the authenticated state general mailbox manipulation is allowed but contents of
the mailbox, I.e. messages, cannot be manipulated until a mailbox has been selected.
Once a mailbox is successfully selected with the Select method or Examine method then the state becomes the selected state, and the Close, Check, Copy, UidCopy, Fetch, UidFetch, Store, UidStore,
Expunge and Search methods are valid. If the Examine method is used to select a mailbox then the mailbox is selected in a read only mode, hence any methods that would modify the messages in the
mailbox is no allowed. The fourth state is the logout state, in this state the connection with the IMAP server is terminated with a call to the Disconnect method.
To manipulate mailboxes the application must first call the Login method. A mailbox can be created through the Create method and to delete a mailbox use the Delete method. A listing of all
the mailboxes can be retrieved by calling the List method, to list only the subscribed mailboxes the ListSubscribed method should be used. The application can subscribe and unsubscribe a mailbox by
using the Subscribe and Unsubscribe methods respectively. The Append method can be used to append a message which is either RFC822 or MIME conformant to a desired mailbox, note that the message would
not be delivered, the Distinct SMTP ActiveX control should be used to deliver any messages.
To manipulate messages the application must first select a mailbox through a call to the Select method. The application can then copy the messages to a different mailbox using the Copy or UidCopy
methods, a message can be retrieved using the Fetch method. The attributes of a message or a set of messages can be changed through a call to the Store or UidStore methods, for example the
application can set the IMAP_MSG_DELETED attribute and then delete the message or messages by calling the Expunge method. The application can also search for messages matching a criteria in
the selected mailbox through the Search method. The application can deselect a selected mailbox by calling the Close method.
The IMAP control allows the user to get into the idle mode and receive real time updates as and when it happens. This is very useful for real time based applications which do not have to poll the
server for updates every few seconds. The application must call the StartIdle method to start the idle mode, then onwards the control will fire OnNotify event whenever any new mail arrives or an
existing mail gets deleted or of any other updates that happen in the selected mailbox. The application must terminate the idle mode by calling the method EndIdle.
At the end the application must call Disconnect method to the close the connection with the IMAP server.
|