| Visual Basic (Declaration) | |
|---|---|
Public Overloads Function BeginLogin( _ ByVal server As String, _ ByVal username As String, _ ByVal password As String, _ ByVal state As Object _ ) As IAsyncResult | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Pop Dim server As String Dim username As String Dim password As String Dim state As Object Dim value As IAsyncResult value = instance.BeginLogin(server, username, password, state) | |
| Managed Extensions for C++ | |
|---|---|
public: IAsyncResult* BeginLogin( string* server, string* username, string* password, Object* state ) | |
| C++/CLI | |
|---|---|
public: IAsyncResult^ BeginLogin( String^ server, String^ username, String^ password, Object^ state ) | |
Parameters
- server
- The POP server to log in to.
- username
- Username used to log in to the POP server.
- password
- Password used to log in to the POP server.
- state
- User state information.
Return Value
An IAsyncResult that represents the asynchronous operation, which could still be pending.| Exception | Description |
|---|---|
| Dart.PowerTCP.Mail.ProtocolException | Bad POP protocol response received from server. |
| System.Net.Sockets.SocketException | The requested address is not valid in its context. |
| System.IO.IOException | The filename, directory name, or volume label syntax is incorrect. |
| System.ArgumentException | A required argument contains invalid characters, is empty, or contains only white spaces. |
This method begins to asynchronously log in to a POP server. Upon completion the Pop.EndLogin event will be raised. An PopEventArgs object will be passed into this event, containing data about the success/failure of the log in.
If you wish to automatically retrieve all messages available in the mail drop, set Pop.AutoGet to MessageHeader.Full prior to logging in. If you would just like to automatically retrieve the header, set Pop.AutoGet to MessageSection.Header.
Use this method when you want to asynchronously log in to a POP server using standard options.
If you are using the Pop component as a reference, you must "wire up" the event yourself. This involves creating a method that acts as the event handler that implements the PopEventHandler delegate. See Using Events When Using A Component As A Reference for more information.
The object state is useful for any kind of state information that you would like accessible in the Pop.EndLogin event. Since the method is "disconnected" from the calling code and returns to the main thread elsewhere, you may wish to pass an object/variable as state to be retrieved and used in the event handler.
To log in synchronously, use Pop.Login
Target Platforms: Microsoft .NET Framework 2.0