Note: This API is now obsolete.
Begins an asynchronous request for a logging in an account on a POP3 server.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax [ObsoleteAttribute("This method is obsolete in .NET 4.5+. Use LoginAsync instead.")]
public IAsyncResult BeginLogin(
string targetName,
string domain,
string accountName,
string password,
AuthenticationMethods authMethods,
AuthenticationOptions authOptions,
SaslMethod authUserDefined,
AsyncCallback callback,
Object state
)
<ObsoleteAttribute("This method is obsolete in .NET 4.5+. Use LoginAsync instead.")>
Public Function BeginLogin (
targetName As String,
domain As String,
accountName As String,
password As String,
authMethods As AuthenticationMethods,
authOptions As AuthenticationOptions,
authUserDefined As SaslMethod,
callback As AsyncCallback,
state As Object
) As IAsyncResult
Parameters
- targetName
- Type: SystemString
The Service Principal Name of the server. Used only with GSSAPI/Kerberos authentication. You can leave it a null reference (Nothing in Visual Basic) or an empty string. - domain
- Type: SystemString
The user account domain on the server. Used only with NTLM and GSSAPI authentication. You can leave it a null reference to use the current domain. - accountName
- Type: SystemString
The user account name on the server. You can leave it a null reference when using NTLM or GSSAPI and wish to authenticate as the current Windows user. - password
- Type: SystemString
The password of the user account on the server. - authMethods
- Type: MailBeeAuthenticationMethods
A set of authentication methods which can be used when logging in a mailbox. - authOptions
- Type: MailBeeAuthenticationOptions
Specifies the options which affect login process. - authUserDefined
- Type: MailBeeSaslMethod
A reference to the instance of user defined authentication method,
or a null reference (Nothing in Visual Basic) if user defined authentication is not used. - callback
- Type: SystemAsyncCallback
The AsyncCallback delegate. You can leave it a null reference
(Nothing in Visual Basic) if you do not use callbacks. - state
- Type: SystemObject
An object that contains state information for this request.
You can leave it a null reference (Nothing in Visual Basic).
Return Value
Type:
IAsyncResultAn
IAsyncResult that references the asynchronous login process.
Exceptions Remarks Examples This sample demonstrates asynchronous logging in a mailbox and use of a callback function
in a console application.
using System;
using MailBee;
using MailBee.Pop3Mail;
class Sample
{
private static void LoginCallback(IAsyncResult result)
{
Pop3 pop = (Pop3)result.AsyncState;
pop.EndLogin();
Console.WriteLine("Overall size of all messages in the inbox is " +
pop.InboxSize + " bytes");
}
static void Main(string[] args)
{
Pop3 pop = new Pop3();
pop.Connect("pop.somehost.com");
IAsyncResult ar = pop.BeginLogin(null, null, "jdoe", "secret",
AuthenticationMethods.Auto, AuthenticationOptions.None,
null, new AsyncCallback(LoginCallback), pop);
System.Threading.Thread.Sleep(3000);
while (pop.IsBusy) ar.AsyncWaitHandle.WaitOne();
pop.Disconnect();
}
}
Imports System
Imports MailBee
Imports MailBee.Pop3Mail
Class Sample
Private Shared Sub LoginCallback(ByVal result As IAsyncResult)
Dim pop As New Pop3
pop = result.AsyncState
pop.EndLogin()
Console.WriteLine("Overall size of all messages in the inbox is " & _
pop.InboxSize & " bytes")
End Sub
Shared Sub Main(ByVal args As String())
Dim pop As New Pop3
pop.Connect("pop.somehost.com")
Dim ar = pop.BeginLogin(Nothing, Nothing, "jdoe", "secret", _
AuthenticationMethods.Auto, AuthenticationOptions.None, _
Nothing, New AsyncCallback(AddressOf LoginCallback), pop)
System.Threading.Thread.Sleep(3000)
While pop.IsBusy
ar.AsyncWaitHandle.WaitOne()
End While
pop.Disconnect()
End Sub
End Class
See Also