Imagine a scenario where you need to send your data to an API in order to utilize the capabilities of MailKit.
This particular package offers support for both IMAP and POP3 protocols.
Here is an example showcasing the use of POP3:
class Program
{
public static void Main (string[] args)
{
using (var client = new Pop3Client ()) {
// To demonstrate, we are accepting all SSL certificates (in case the server supports STARTTLS)
client.ServerCertificateValidationCallback = (s,c,h,e) => true;
client.Connect ("pop.friends.com", 110, false);
client.Authenticate ("joey", "password");
for (int i = 0; i < client.Count; i++) {
var message = client.GetMessage (i);
Console.WriteLine ("Subject: {0}", message.Subject);
}
client.Disconnect (true);
}
}
}