Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read incoming mail using C# [closed]

I am looking for a solution to allow me to read incoming emails. The three methods I can think of to do this at the moment are:

  1. Create an Email Server parsing emails
  2. Hook into an existing exchange server
  3. Hook into outlook that is already set up with an email account

What is the best way to do this? And how does one go about implementing it?

Thanks

like image 531
Chris Avatar asked Jan 06 '11 12:01

Chris


2 Answers

If you are already dealing with an Exchange server as the mailbox host I would suggest leveraging that via IMAP (preferred) or POP access. Recently I developed a solution that accesses a specified mailbox via AfterLogic's MailBee.NET IMAP component which I think is worth the recommendation. They have a standard trial version and reasonable pricing. Also if you go this route either POP or IMAP automation is flexible enough to work with almost any mailbox server platform; It doesn't have to be limited to Exchange environments.

There are also free .NET IMAP components out there that may do the job as well. In my limited research I found that the free alternatives didn't quite meet all of my requirements or were not as easy to learn but your situation may differ. For completeness, here is a list of alternative / free IMAP libraries I considered before deciding to spend the money on MailBee:

  • ImapX - http://hellowebapps.com/products/imapx/
  • LumiSoft.Net Imap Client - http://www.lumisoft.ee/lswww/download/downloads/Net/
  • InterIMAP - http://interimap.codeplex.com/

To address the 2nd part of your question... The implementation in my recent project involved writing a very simple console application that references the MailBee.NET IMAP library. The console application has a standard config file and accepts command line arguments as parameters. We define Windows scheduled tasks to run the console application according to our process needs. I am sure you could do this any number of other ways but this was the simplest approach for our needs.

like image 87
Saul Dolgin Avatar answered Sep 30 '22 08:09

Saul Dolgin


I know this is an older thread but I wanted to add a link to a great open source Imap library called ImapX2: http://imapx.codeplex.com/

I tried most of the links in this thread to varying degrees of success but I found that the ImapX2 library work the best according to my needs.

like image 42
Mark Kram Avatar answered Sep 30 '22 08:09

Mark Kram