Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for a .NET component to access an email inbox [closed]

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?

like image 563
Ian Nelson Avatar asked Aug 20 '08 13:08

Ian Nelson


People also ask

Which one is the correct option to send a mail message in asp net?

For sending email we need a SMTP Server, so in ASP.Net we have the SmtpClient class, using that class object we set its properties for the SMTP settings. SmtpClient client = newSmtpClient("smtp.gmail.com", 587);

What is SMTP in C#?

Sending an email using SMTP. The standard approach to send an email using C# is SMTP (Simple Mail Transfer Protocol). It is a network protocol used to send emails over the internet.


1 Answers

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

like image 103
Pawel Lesnikowski Avatar answered Nov 05 '22 15:11

Pawel Lesnikowski