SmtpBeginAuthPopBeforeSmtp Method

Note: This API is now obsolete.

Begins an asynchronous request for a POP-before-SMTP authentication on a mail server.

Namespace: MailBee.SmtpMail
Assembly: 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 AuthPopBeforeSmtpAsync instead.")]
public IAsyncResult BeginAuthPopBeforeSmtp(
	string pop3ServerName,
	int pop3ServerPort,
	string pop3AccountName,
	string pop3Password,
	AsyncCallback callback,
	Object state
)

Parameters

pop3ServerName
Type: SystemString
The host name or IP address of the POP3 server.
pop3ServerPort
Type: SystemInt32
The port on which POP3 service is running.
pop3AccountName
Type: SystemString
The user account name on the POP3 server.
pop3Password
Type: SystemString
The user account password on the POP3 server.
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: IAsyncResult
An IAsyncResult that references the asynchronous POP-before-SMTP authentication.
Exceptions
ExceptionCondition
MailBeeInvalidStateExceptionThere is already an operation in progress.
Remarks
This method is an asynchronous version of AuthPopBeforeSmtp(String, Int32, String, String).
Examples
This WinForms sample demonstrates how to perform POP-before-SMTP authentication asynchronously.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.SmtpMail;

// Put the code below inside your class.

// The actual code.
private void Form1_Load(object sender, System.EventArgs e)
{
    Smtp mailer = new Smtp();

    // Let MailBee process events.
    mailer.RaiseEventsViaMessageLoop = false;

    mailer.SmtpServers.Add("mail.domain.com");

    // Initiate an asynchronous POP-before-SMTP authentication attempt.
    mailer.BeginAuthPopBeforeSmtp("mail.domain.com", 110, "jdoe", "secret", null, null);

    // Simulate some lengthy work here...
    for (int i = 0; i < 100; i++)
    {
        // Make a portion of the work.
        System.Threading.Thread.Sleep(10);

        // Process events which were raised during execution of the work above.
        mailer.Wait(0);
    }

    // End the POP-before-SMTP operation. If it's in progress at the moment 
    // this method starts, it will wait until it's done first.
    mailer.EndAuthPopBeforeSmtp();

    // Connect to SMTP server and say Hello.
    mailer.Connect();
    mailer.Hello();

    // Can send mail here or do whatever needed.
    // ...

    // Close the connection.
    mailer.Disconnect();
}
See Also