(Insist to say that my opinion is based only on my user experience and it's not an add)
Some sample code from the web-site:
All you need is to reference Mail.dll.
using Lesnikowski.Client.IMAP;
using Lesnikowski.Mail;
using Lesnikowski.Mail.Headers;
using Lesnikowski.Mail.Headers.Constants;
using System;
class Program
{
static void Main(string[] args)
{
Imap imap = new Imap();
imap.Connect("mail.host.com");
imap.User = "lesnikowski";
imap.Password = "password";
imap.Login();
imap.SelectInbox();
Listuids = imap.SearchFlag(Flag.Unseen);
foreach (long uid in uids)
{
string eml = imap.GetMessageByUID(uid);
ISimpleMailMessage email = new SimpleMailMessageBuilder()
.CreateFromEml(eml);
Console.WriteLine(email.Subject);
Console.WriteLine(email.TextDataString);
}
imap.Close(true);
}
};
Easy and nice, right? :)
0 коментара:
Публикуване на коментар