Search code examples
c#outlook-2003

Automated processing of an Email in C#


Similar question as this one but for a Microsoft Environment.

Email --> Exchange Server -->[something]

For the [something] I was using Outlook 2003 & C# but it feels messy (A program is trying to access outlook, this could be a virus etc)

Microsoft.Office.Interop.Outlook.Application objOutlook = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace objNS = objOutlook.GetNamespace("MAPI");
objNS.Logon("MAPIProfile", "MAPIPassword", false, true);

Is this the best way to do it? Is there a better way of retrieving and processing emails in a Microsoft environment???


Solution

  • This library provides you basic support for the POP3 protocol and MIME, you can use it to check specified mailboxes and retrieve emails and attachments, you can tweak it to your needs.

    Here is another library, this one is for the IMAP protocol, it's very basic but also allows you to fetch complete messages, including attachments...