MAPI and .Net - Microsoft says both supported and not?

E

eadams

I've been tasked with writing an application in VB.Net that will
manipulate messages in a user's Inbox. My Exchange admin prefers that
I use MAPI; I don't really care, but I want this to be as easy as
possible. The application will ultimately be installed on a machine
that will NOT have Outlook installed. But as I've been looking into
how to do this, I'm finding conflicting information.

First, there is this article from Microsoft web site:

http://support.microsoft.com/default.aspx?scid=kb;en-us;813349

Which states pretty clearly that "CDO 1.2x and MAPI are not supported
in a .NET Framework environment". That page recommends WebDAV be used
instead. But then there's this page:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_techsel_tech_13.asp

Which opines "Using MAPI is supported under the COM Interoperability
layer of Visual Studio .NET and the .NET Framework".
From other research I've done, it looks like you can do MAPI with .Net
via the MSMapi32.ocx that shipped with VB 6, but it is tricky. It is
especially problematic when run as a Windows service, which my program
probably will be.

Can someone shed some light on this? I don't want to waste a lot of
time writing to MAPI if it isn't going to work, but I also have to keep
my Exchange admin placated.

Erik
(e-mail address removed)
 
J

Jay B. Harlow [MVP - Outlook]

Erik,
The way I interpret it is:

CDO & MAPI specifically are not supported under .NET, if you have a problem
specific to CDO or MAPI & you are using .NET you will not receive any
support from Microsoft (of course if you can replicate the problem in VB or
C++ then they may support you).

COM Interop is specifically supported under .NET. If you have a COM interop
problem that can be replicated with COM objects other then CDO or MAPI,
Microsoft will help you.


FWIW: I have a project that uses CDO 1.2.1 from VB.NET & it doesn't have any
real problems (other then normal CDO quirks). The "biggest" problem is that
CDO 1.2.1 parameters & return values are all defined as Variant in the type
lib, so they are Object in .NET. This makes working with them with Option
Strict On in VB.NET or in C# to be very taxing, as you need to constantly
cast the return values to useful types...

Hope this helps
Jay


| I've been tasked with writing an application in VB.Net that will
| manipulate messages in a user's Inbox. My Exchange admin prefers that
| I use MAPI; I don't really care, but I want this to be as easy as
| possible. The application will ultimately be installed on a machine
| that will NOT have Outlook installed. But as I've been looking into
| how to do this, I'm finding conflicting information.
|
| First, there is this article from Microsoft web site:
|
| http://support.microsoft.com/default.aspx?scid=kb;en-us;813349
|
| Which states pretty clearly that "CDO 1.2x and MAPI are not supported
| in a .NET Framework environment". That page recommends WebDAV be used
| instead. But then there's this page:
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_techsel_tech_13.asp
|
| Which opines "Using MAPI is supported under the COM Interoperability
| layer of Visual Studio .NET and the .NET Framework".
|
| >From other research I've done, it looks like you can do MAPI with .Net
| via the MSMapi32.ocx that shipped with VB 6, but it is tricky. It is
| especially problematic when run as a Windows service, which my program
| probably will be.
|
| Can someone shed some light on this? I don't want to waste a lot of
| time writing to MAPI if it isn't going to work, but I also have to keep
| my Exchange admin placated.
|
| Erik
| (e-mail address removed)
|
 
C

Chad Z. Hower aka Kudzu

(e-mail address removed) wrote in
I've been tasked with writing an application in VB.Net that will
manipulate messages in a user's Inbox. My Exchange admin prefers that
I use MAPI; I don't really care, but I want this to be as easy as
possible. The application will ultimately be installed on a machine
that will NOT have Outlook installed. But as I've been looking into
how to do this, I'm finding conflicting information.

MAPI will still require some client to be installed AFAIK.

If Outlook is installed, COM Interop is better. If it not, you should consider contacting Exchange
directly, or maybe using IMAP4.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
 
E

Erik

This makes working with them with Option
Strict On in VB.NET or in C# to be very taxing,
as you need to constantly cast the return values to useful types...

Darn that strong typing :)

This helps. Frankly, if it will work then I'm ok with it. I'm not
thrilled about doing something "unsupported", but I guess that's life
sometimes.
 
E

Erik

If Outlook is installed, COM Interop is better. If it not, you
should consider contacting Exchange directly, or maybe using IMAP4.

I'm not sure what you mean by "contacting Exchange directly". I've
read my application could use IMAP4 (via sockets talking to the
Exchange server directly) or WebDAV (VB.Net has classes to make this
pretty easy).
But, as I said, my Exchange admin insists on MAPI. When I've suggested
that MY life would be easier using WebDAV or IMAP4, his eyes glazed
over and he said "You can do that with MAPI". Very Jonestown.
 
C

Chad Z. Hower aka Kudzu

Erik said:
I'm not sure what you mean by "contacting Exchange directly". I've
read my application could use IMAP4 (via sockets talking to the
Exchange server directly) or WebDAV (VB.Net has classes to make this
pretty easy).

You might try to convince him... Indy has support for IMAP4, and its free:
http://www.indyproject.org/
But, as I said, my Exchange admin insists on MAPI. When I've suggested
that MY life would be easier using WebDAV or IMAP4, his eyes glazed
over and he said "You can do that with MAPI". Very Jonestown.

This wont solve your problem, but it might put a different perspective on it:
http://tinyurl.com/avfbp


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
 

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