Pop3BeginLogin Method

Note: This API is now obsolete.

Begins an asynchronous request for a logging in an account on a POP3 server.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
[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


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.
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.
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.
Type: SystemString
The password of the user account on the server.
Type: MailBeeAuthenticationMethods
A set of authentication methods which can be used when logging in a mailbox.
Type: MailBeeAuthenticationOptions
Specifies the options which affect login process.
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.
Type: SystemAsyncCallback
The AsyncCallback delegate. You can leave it a null reference (Nothing in Visual Basic) if you do not use callbacks.
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: IAsyncResult
An IAsyncResult that references the asynchronous login process.
MailBeeInvalidStateExceptionThere is already an operation in progress.
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
    // A callback function.
    private static void LoginCallback(IAsyncResult result)
        Pop3 pop = (Pop3)result.AsyncState;
        Console.WriteLine("Overall size of all messages in the inbox is " +
            pop.InboxSize + " bytes");

    // The actual code.
    static void Main(string[] args)
        Pop3 pop = new Pop3();


        // Initiate an asynchronous login attempt.
        IAsyncResult ar = pop.BeginLogin(null, null, "jdoe", "secret",
            AuthenticationMethods.Auto, AuthenticationOptions.None,
            null, new AsyncCallback(LoginCallback), pop);

        // Simulate some lengthy work here. At the same time,
        // login is executed on another thread.

        // If the login attempt is still in progress, then wait until it's finished.
        while (pop.IsBusy) ar.AsyncWaitHandle.WaitOne();

        // Disconnect from the server.
See Also