SmtpConnected Event
Occurs when the connection with the server is successfully established.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public event ConnectedEventHandler Connected

Value

Type: MailBeeConnectedEventHandler
Remarks
This event indicates successful completion of the connection procedure, while SocketConnected event (occurs before Connected) indicates the connection request from MailBee was accepted by the server, and the SMTP connection procedure will now begin.

If POP-before-SMTP authentication is used and MailBee successfully connects to the POP3 server, this event is raised as well. The developer can examine Protocol property value to determine whether the connection was made to POP3 or SMTP server.

Examples
This sample uses Connected event to report the successful connection status into console.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
{
    // Connected event handler.
    private static void OnConnected(object sender, ConnectedEventArgs e)
    {
        Console.WriteLine("Successfully connected to the server.");
    }

    // The actual code.
    static void Main(string[] args)
    {
        Smtp mailer = new Smtp();
        mailer.SmtpServers.Add("smtp.domain.com");

        // Subscribe to the Connected event.
        mailer.Connected += new ConnectedEventHandler(OnConnected);

        mailer.Connect();
        mailer.Disconnect();
    }
}
See Also