tags:

views:

1272

answers:

5

Extract Email Attachments from Outlook (exchange server) using C#

I need to run a script or Service - Which can automatically deduct the attachment file from a Specific Email Id ( [email protected]).

Attachment file will be .zip format.

I need to Unzip this file.. I need to do this task completely in an automated format.

On an average, I will receive only one email in a week.

I need to write the program in C#.Net...!

Kindly help me by sharing your logics ... Many thanks in advance..!

+1  A: 

While this is fairly broad... Don't try to go through Outlook; there are easier ways. I'd Google for the following:

C# IMAP
C# POP3
ICSharpCode.net (zip)

Austin Salonen
A: 

Regarding connecting to Exchange server mailbox and checking attachments of email messages, you can use Aspose.Network library, a 3rd party .NET component. More details are available at http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/managing-emails-on-exchange-server.html

Saqib Razzaq
A: 

If it's an Exchange 2007 server use the Exchange Web Services SDK. There are several examples here: http://blogs.msdn.com/mstehle/archive/2007/01/23/fyi-exchange-2007-web-services-around-the-web.aspx

xcud
A: 

I highly recomment Outlook Redemption which is a COM library to access outlook and Exchange through MAPI. Since its COM you should be able to easily use it from C# .NET

Hannes de Jager
A: 

I have implemented quite exactly this on a project (though it was in Java).

We just used an IMAP client library to grab the mails, then Java's mail libraries to extract ZIP attachments and decompress them.

The same should work in C#; the advantage being that you do not rely on Exchange, just on IMAP, which means you don't tie yourself to Exchange. You might however ask the admin to activate IMAP on the Exchange server.

Also, you'll need to find an IMAP library for C#; don't know if there is one.

sleske