MAPI in .NET 2.0 without Outlook installed to work with Exchange 2003?

T

Tarren

Hi, All:

I am tasked with the following. I need to write a service to monitor an
Exchange mailbox and take action when an email is received, put it in a db,
etc. I do not need to send emails through MAPI, only monitor a folder in
exchange.

Can I use .NET objects to do this or do I absolutely need a 3rd party add-in
such as Outlook Redemption. This has to go on an enterprise production
server, so the server group will fight me hard if I tell them that i need a
3rd party add-in with my service.

Here is the fun part. No outlook on the machine, so I cannot instantiate
Outlook application. And, since it is a service, not user based, no option
for security prompts. I am not sending email through MAPI, only reading the
mailbox with supplied credentials. Is this possible with config laid out
(no outlook / has to run as service / built in .NET objects only)? Any
links / tips to put me in the right direction?

Thanks in advance!
 
N

Nicholas Paldino [.NET/C# MVP]

Tarren,

What version of Exchange are you working with?

Honestly, I don't see why you would write this as a service, it would
just be a waste of resources (especially all the work trying to tie in the
service with exchange, and getting notifications).

I would check out the Exchange section on the MSDN site, particularly,
the SDK for the version of exchange you are running:

http://msdn.microsoft.com/exchange

If you want to filter email just from the outside world, then you can
create an SMTP event sink which will be called when an email is sent through
SMTP. If you want to monitor internal emails as well, then you need to
create a Store Event Sink, which will be activated whenever an item is
modified in the store (a user's inbox, for example).

It seems that all of these sinks require implementations of COM
interfaces, which is completely possible in .NET, but will take a little
work (and not require a service on your part).

Hope this helps.
 
T

Tarren

Thank you. I will look into what options are out there.

Nicholas Paldino said:
Tarren,

What version of Exchange are you working with?

Honestly, I don't see why you would write this as a service, it would
just be a waste of resources (especially all the work trying to tie in the
service with exchange, and getting notifications).

I would check out the Exchange section on the MSDN site, particularly,
the SDK for the version of exchange you are running:

http://msdn.microsoft.com/exchange

If you want to filter email just from the outside world, then you can
create an SMTP event sink which will be called when an email is sent
through SMTP. If you want to monitor internal emails as well, then you
need to create a Store Event Sink, which will be activated whenever an
item is modified in the store (a user's inbox, for example).

It seems that all of these sinks require implementations of COM
interfaces, which is completely possible in .NET, but will take a little
work (and not require a service on your part).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tarren said:
Hi, All:

I am tasked with the following. I need to write a service to monitor an
Exchange mailbox and take action when an email is received, put it in a
db, etc. I do not need to send emails through MAPI, only monitor a
folder in exchange.

Can I use .NET objects to do this or do I absolutely need a 3rd party
add-in such as Outlook Redemption. This has to go on an enterprise
production server, so the server group will fight me hard if I tell them
that i need a 3rd party add-in with my service.

Here is the fun part. No outlook on the machine, so I cannot instantiate
Outlook application. And, since it is a service, not user based, no
option for security prompts. I am not sending email through MAPI, only
reading the mailbox with supplied credentials. Is this possible with
config laid out (no outlook / has to run as service / built in .NET
objects only)? Any links / tips to put me in the right direction?

Thanks in advance!
 
J

JimD

Tarren said:
Hi, All:

I am tasked with the following. I need to write a service to monitor an
Exchange mailbox and take action when an email is received, put it in a db,
etc. I do not need to send emails through MAPI, only monitor a folder in
exchange.

Can I use .NET objects to do this or do I absolutely need a 3rd party add-in
such as Outlook Redemption. This has to go on an enterprise production
server, so the server group will fight me hard if I tell them that i need a
3rd party add-in with my service.

Here is the fun part. No outlook on the machine, so I cannot instantiate
Outlook application. And, since it is a service, not user based, no option
for security prompts. I am not sending email through MAPI, only reading the
mailbox with supplied credentials. Is this possible with config laid out
(no outlook / has to run as service / built in .NET objects only)? Any
links / tips to put me in the right direction?

Thanks in advance!

If you want to do it with .Net, you can just poll the folder with
WebDav. It is pretty simple. If you want me to email you an example
project off list, let me know.

Jim
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
You roll an 18 in Dex and see if you
don't end up with a girlfriend
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
JimD
Central FL, USA, Earth, Sol
 
T

Tarren

Thanks, Jim. Ironically enough this, prior to seeing your response this was
the route I discovered by trial and error and exhaustive research. I was
able to do it 100% in .NET namespaces which makes it a lot easier, since I
did not have to use MSXML either. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top