Recommendations for a .NET component to access an

2019-01-06 12:50发布

I've been asked to write a Windows service in C# to periodically monitor an email inbox and insert the details of any messages received into a database table.

My instinct is to do this via POP3 and sure enough, Googling for ".NET POP3 component" produces countless (ok, 146,000) results.

Has anybody done anything similar before and can you recommend a decent component that won't break the bank (a few hundred dollars maximum)?

Would there be any benefits to using IMAP rather than POP3?

11条回答
Summer. ? 凉城
2楼-- · 2019-01-06 12:55

How about WCF? It's free.

If you have an Exchange server: http://msdn.microsoft.com/en-us/library/bb397812.aspx

an example for pop3: http://bartdesmet.net/blogs/bart/archive/2006/09/13/4417.aspx

查看更多
欢心
3楼-- · 2019-01-06 12:57

IMAPX2 is the best. Using IMAP you can control the folders in a mail server, a thing you wouldn't be able to do using POP. IMAPX is an open source code you can look into, and is free to use.

IMAPX is straight forward and reliable.

查看更多
Evening l夕情丶
4楼-- · 2019-01-06 13:01

I would recommend AdvancedIntellect. There are components for POP3 and IMAP (ASPNetPOP3 and ASPNetIMAP). Good quality and very responsive support - I remember receiving replies to my questions on a weekend.

查看更多
Deceive 欺骗
5楼-- · 2019-01-06 13:05

With IMAP protocol you can access sub folders, and set message status (seen/unseen), also you can use IDLE feature for instant notifications.

Mail.dll includes POP3, IMAP, SMTP components with SSL support and powerful MIME parser:

using(Imap imap = new Imap())
{
    imap.Connect("imap.server.com");    // or ConnectSSL for SSL
    imap.Login("user", "password");

    imap.SelectInbox();
    List<long> uids = imap.Search(Flag.Unseen);
    foreach (long uid in uids)
    {
        IMail mail = new MailBuilder()
            .CreateFromEml(imap.GetMessageByUID(uid));
        Console.WriteLine(mail.Subject);
    }
    imap.Close();
}

Please note that this is commercial product that I've created.

You can download it at https://www.limilabs.com/mail

查看更多
可以哭但决不认输i
6楼-- · 2019-01-06 13:05

Lumisoft is open-source and includes IMAP and POP clients (among other stuff). I've been using them for years with no problems.

查看更多
孤傲高冷的网名
7楼-- · 2019-01-06 13:09

You can do this using MailBee.NET Objects: http://www.afterlogic.com/products/net-email-components

While I'd recommend to use IMAP indeed, particularly since it offers IDLE support mentioned here already, you could do the same with POP3. There's a brief description of both the approaches, and a complete sample for IMAP IDLE scenario:

http://www.afterlogic.com/wiki/Getting_notifications_about_new_messages_in_mailbox_%28IMAP_IDLE_and_polling%29

Please note that I am affiliated with AfterLogic, and I'll be pleased to assist you if you need any help, check Request Support option at our website.

查看更多
登录 后发表回答