Occurs when the component successfully authenticates the user on the server and logs
in the user account.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax Remarks After raising this event, the component will download the mailbox statistics
from the mail server (number of messages in the mailbox, and other information as
specified by
InboxPreloadOptions property setting.
Examples This sample connects to the POP3 server, logs in the user account, and downloads
the complete mailbox statistics. The sample demonstrates there is a delay between
LoggedIn event occurence and
Login(String, String, String, String, AuthenticationMethods, AuthenticationOptions, SaslMethod) method completion,
which is the amount of time spent on downloading the mailbox statistics after
completion of the authentication process.
using System;
using MailBee;
using MailBee.Pop3Mail;
class Sample
{
private static void OnLoggedIn(object sender, LoggedInEventArgs e)
{
Console.WriteLine("Successfully logged in the user account at " +
(DateTime.Now - DateTime.Today));
}
static void Main(string[] args)
{
Pop3 pop = new Pop3();
pop.LoggedIn += new LoggedInEventHandler(OnLoggedIn);
pop.Connect("mail.domain.com");
pop.InboxPreloadOptions = Pop3InboxPreloadOptions.List | Pop3InboxPreloadOptions.Uidl;
pop.Login("jdoe", "secret");
Console.WriteLine("The user account statistics received at " +
(DateTime.Now - DateTime.Today));
pop.Disconnect();
}
}
Imports System
Imports MailBee
Imports MailBee.Pop3Mail
Class Sample
Private Shared Sub OnLoggedIn(ByVal sender As Object, ByVal e As LoggedInEventArgs)
Dim DNow As DateTime = DateTime.Now
Dim DToday As DateTime = DateTime.Today
Console.WriteLine("Successfully logged in the user account at " & _
DateDiff(DateInterval.Hour, DateTime.Now, DateTime.Today))
End Sub
Shared Sub Main(ByVal args As String())
Dim pop As New Pop3
AddHandler pop.LoggedIn, AddressOf OnLoggedIn
pop.Connect("mail.domain.com")
pop.InboxPreloadOptions = Pop3InboxPreloadOptions.List Or Pop3InboxPreloadOptions.Uidl
pop.Login("jdoe", "secret")
Console.WriteLine("The user account statistics received at " & _
DateDiff(DateInterval.Hour, DateTime.Now, DateTime.Today))
pop.Disconnect()
End Sub
End Class
See Also