Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MAPISendMail code 2 (MAPI_E_FAILURE) when run in Vista with outlook running

2,266 views
Skip to first unread message

Rich Carreiro

unread,
Mar 22, 2007, 3:42:51 PM3/22/07
to
We have C++ code that uses MAPISendMail (from MAPI32.DLL) to open an
instance of the local mail client to send an email.

It works fine on Win2K, Win2K3, and XP, whether or not Outlook is running
at the time MAPISendMail is called.

However, on Vista, MAPISendMail fails and returns error code 2
(MAPI_E_FAILURE)
if Outlook (2003 or 2007) is running when the call is made. If Outlook is
*not*
running, MAPISendMail works without a hitch.

Any ideas on what could be causing this or how to get more detailed failure
information?

== Rich Carreiro
rcar...@saba.com


Reeves@discussions.microsoft.com Allen Reeves

unread,
May 1, 2007, 3:18:01 PM5/1/07
to

I have the exact same problem. Does anybody have any resolution. I've tried:

Using MAPILogon to explicitly connect to a session. No effect.
Calling MAPIInitialize and saying 'hey, run in multithreaded mode.' No
effect.
Calling the MFC MAPI wrapper. Same problem.

Help.

Stephen Griffin [MSFT]

unread,
May 1, 2007, 4:01:12 PM5/1/07
to
Yeah - that's broken. We're working on fixing it. I'll try to remember to
post when it's done.

Steve

"Allen Reeves" <Allen Ree...@discussions.microsoft.com> wrote in message
news:A4901C81-E82D-4D7B...@microsoft.com...

Matthias Roth

unread,
Jul 6, 2007, 12:15:21 PM7/6/07
to
We have the same problem.
When will it be fixed?
Or is there any workaround?

Matthias

JohnC

unread,
Jul 24, 2007, 11:54:03 AM7/24/07
to
I am looking for a solution to this problem as well. Any ETA on a fix?

John Cullen

unread,
Jul 25, 2007, 11:08:01 AM7/25/07
to
Seems like this problem only occurs when running the app in the VS debugger.
Running the compiled .exe seems to work fine... on my machine anyway.

Stephen Griffin [MSFT]

unread,
Aug 7, 2007, 4:54:08 PM8/7/07
to
Hey - I just realized the issue you're reporting is NOT the same one I've
been tracking, but you should test this fix anyway:
http://blogs.msdn.com/stephen_griffin/archive/2007/08/07/simple-mapi-and-vista.aspx

Given what I know about the root cause of the problem in the blog post, it's
possible what you're seeing is just another manifestation. Or maybe it's
something completely different. :)

Steve

"JohnC" <Jo...@discussions.microsoft.com> wrote in message
news:8A0F4BD4-7994-46A2...@microsoft.com...

randallmoore

unread,
Oct 1, 2007, 2:29:44 PM10/1/07
to
I'm seeing this same problem with my application, and the Hotfix does NOT fix it. If you send an email via MAPI and the email client is NOT running (Windows Mail or Outlook), it works. If the email client is already open, I get an error. Is some one still working on this?

You can easily reproduce it. If you need test software, download and install our bug tracker: http://www.IssueView.com/IV50.exe. After you get it installed, rightClick on an issue in the grid and select email. On Vista, If Windows Email is open you'll get an error. If Windows Email isn't open, it will work. It always works on all other OSs.

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com

Randal...@gmail.com

unread,
Oct 1, 2007, 6:14:45 PM10/1/07
to
On Oct 1, 11:29 am, Randall Moore wrote:
> I'm seeing this same problem with my application, and the Hotfix does NOT fix it. If you send an email viaMAPIand the email client is NOT running (Windows Mail or Outlook), it works. If the email client is already open, I get an error. Is some one still working on this?
>
> You can easily reproduce it. If you need test software, download and install our bug tracker:http://www.IssueView.com/IV50.exe. After you get it installed, rightClick on an issue in the grid and select email. OnVista, If Windows Email is open you'll get an error. If Windows Email isn't open, it will work. It always works on all other OSs.

>
> EggHeadCafe - .NET Developer Portal of Choicehttp://www.eggheadcafe.com

An additional note. I disabled UAC, and the problem went away. With
UAC enabled, it takes about 30 seconds to fail. Is sounds to me like
a prompt is being supressed when UAC is enabled. Assuming this is
true, how does one allow the UAC prompting to 'flow through'?

0 new messages