Occurs when the connection with the server is successfully established.
Namespace: MailBee.ImapMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax 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 IMAP4
connection procedure will now begin.
Examples This sample uses
Connected event to report
the successful connection status into console.
using System;
using MailBee;
using MailBee.ImapMail;
class Sample
{
private static void OnConnected(object sender, ConnectedEventArgs e)
{
Console.WriteLine("Successfully connected to the server.");
}
static void Main(string[] args)
{
Imap imp = new Imap();
imp.Connected += new ConnectedEventHandler(OnConnected);
imp.Connect("imap.domain.com");
imp.Disconnect();
}
}
Imports System
Imports MailBee
Imports MailBee.ImapMail
Module Sample
Private Sub OnConnected(ByVal sender As Object, ByVal e As ConnectedEventArgs)
Console.WriteLine("Successfully connected to the server.")
End Sub
Sub Main(ByVal args As String())
Dim imp As New Imap
AddHandler imp.Connected, AddressOf OnConnected
imp.Connect("imap.domain.com")
imp.Disconnect()
End Sub
End Module
See Also