OnUpdate Event  
 

The OnUpdate event is generated when the server sends a mailbox update notification to the client.

Syntax

Sub object_OnUpdate ( [Index As Integer], ByVal UpdateType As Variant, ByVal MessageNumber As Variant )

Remarks

The OnUpdate event is generated when the server sends a notification to the client that a new message has been stored in the mailbox, or when a message has been expunged from the mailbox. The arguments to this event are:

UpdateType
An integer value which specifies the type of update notification that has been sent by the server. It may be one of the following values:
Value Constant Description
0 imapUpdateUnknown The server has sent an unrecognized notification message. The value of the MessageNumber argument is undefined for this type of notification. This does not necessarily reflect an error condition, as some servers may send additional notification messages beyond the standard EXISTS, EXPUNGE and RECENT messages. Most applications should ignore this type of notification.
1 imapUpdateMessage The server has sent notification message to the client indicating that a new message has arrived. The MessageNumber argument will contain the message number for the new message. Typically this update notification occurs shortly after the new message has been stored in the current mailbox.
2 imapUpdateExpunge The server has sent a notification message to the client indicating that a message has been removed from the current mailbox. The MessageNumber argument will contain the message number for the message that has been removed. It is recommended that the application re-examine the mailbox when this notification is received. Typically this notification is only sent periodically by the server, and may not be sent immediately after a message has been expunged from the mailbox.
3 imapUpdateMailbox The server has sent notification message to the client indicating that the state of the mailbox has changed. The MessageNumber argument is not used with this notification. This message is sent periodically by the server and may not be sent immediately after a new message arrives or a message is flagged as unread. It is recommended that the application re-examine the mailbox when this notification is received.
MessageNumber
An integer value which specifies the message number associated with the status change. Note that this argument is not used with the imapUpdateMailbox notification and will contain a value of zero.

This event is only generated when the Idle method has been used to enable mailbox status monitoring.

See Also

Idle Method