wodPop3Server ActiveX Control - StateChange Method
      
 

Description

Called when user's state changes


Return Type

None  


Syntax

object.StateChange Owner, User, NewState, OldState



The StateChange Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodPop3Notify.
Owner  A wodPop3ServerCom object. Reference to wodPop3ServerCom instance that called this callback method.
User  A Pop3User object. Reference to user whose state has changed.
NewState  A Pop3UserStates enumeration, as described in settings.

Represents new state.

OldState  A Pop3UserStates enumeration, as described in settings.

Represents previous state.


Settings

The settings for NewState are:

Constant Value Description
 StateNotConnected 0 User is not connected.
 StateConnecting 1 User is connecting.
 StateWaitingUsername 2 User is about to send username.
 StateWaitingPassword 3 User is about to send password
 StateLoggedIn 4 User logged in successfully
 StateSendingMessage 5 User is reading message

The settings for OldState are:

Constant Value Description
 StateNotConnected 0 User is not connected.
 StateConnecting 1 User is connecting.
 StateWaitingUsername 2 User is about to send username.
 StateWaitingPassword 3 User is about to send password
 StateLoggedIn 4 User logged in successfully
 StateSendingMessage 5 User is reading message

Remarks

NOTE: This method is called only if you implemented IwodPop3Notify interface in your application, and wodPop3Server1.Notification property has received reference to instance of your implementation.

StateChange notification method is called each time user's state changes. From the beginning, when user tries to connect to server, his state will be set to 'StateConnecting'. Once he connects successfully and starts accessing his mail, mostly 'StateLoggedIn' will be set. During message retrieval, StateSendingMessage will be set.

Depending on values provided by this notification method, you can inspect user's behavior on your server, deny access to it or just store it locally for debugging purposes.