Introduction
If you prefer more control over the commands sent during the POP session, this is for you. You are expected to completely interact when using the library in this manner.
Code Example
using (
DefaultPop3Client client = new DefaultPop3Client(account.hostName, account.hostPort, account.useSSL, account.userName,
account.password)
)
{
//client.Trace += Console.WriteLine;
//connects to Pop3 Server, Executes POP3 USER and PASS
client.Authenticate();
client.GetStatistics();
foreach (Pop3ListItemResult item in client.List())
{
SidePOPMailMessage message = client.RetrieveExtendedMailMessage(item);
Log.bound_to(typeof(Program)).log_an_info_event_containing("Children.Count: {0}", message.Children.Count);
Log.bound_to(typeof(Program)).log_an_info_event_containing("message-id: {0}", message.MessageId);
Log.bound_to(typeof(Program)).log_an_info_event_containing("subject: {0}", message.Subject);
Log.bound_to(typeof(Program)).log_an_info_event_containing("Attachments.Count: {0}", message.Attachments.Count);
if (!message.IsBodyHtml)
{
Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
}
else
{
Log.bound_to(typeof(Program)).log_an_info_event_containing("Message.Body: {0}", message.Body);
}
//client.Delete(item);
}
client.SendNoOperation();
client.SendReset();
client.Quit();
}