IMAP component and POP3 component that allows you to receive emails and process/parse email messages in .NET applications. Includes SMTP component for sending, along with email signing, encrypting and signature verification. Written entirely in managed code. Works with .NET 2.0, 3.0, 3.5, 4.0 and 4.5+ including Mono. Features
Receiving and parsing emails from IMAP servers is really easy: C#: using(Imap imap = new Imap()) { imap.Connect("imap.server.com"); // or ConnectSSL for SSL imap.UseBestLogin("user", "password"); imap.SelectInbox(); List uids = imap.Search(Flag.Unseen); foreach (long uid in uids) { IMail email = new MailBuilder() .CreateFromEml(imap.GetMessageByUID(uid)); Console.WriteLine(email.Subject); } imap.Close(); } VB.NET: Using imap As New Imap imap.Connect("imap.server.com") ' or ConnectSSL for SSL imap.UseBestLogin("user", "password") imap.SelectInbox() Dim uidList As List(Of Long) = imap.Search(Flag.Unseen) For Each uid As Long In uidList Dim email As IMail = New MailBuilder() _ .CreateFromEml(imap.GetMessageByUID(uid)) Console.WriteLine(email.Subject) Next imap.Close() End Using
Please visit https://www.limilabs.com/mail for more samples.
|