Article ID: 315500 - View products that this article applies to.
This article was previously published under Q315500
If you have Microsoft MSN Hotmail set as your default e-mail client, you may receive the MAPI_E_FAILURE (2) MAPI result code when you call Simple MAPI functions other than MAPISendMail, MAPILogon, and MAPILogoff. You may also receive with MAPI_E_FAILURE (2) MAPI result code if you use a Microsoft Visual Basic code to call the MAPISendMail function.
This behavior can occur because the Hotmail Simple MAPI that is included with Microsoft Internet Explorer and that is contained in the Hmmapi.dll file only implements the three functions exported as MAPISendMail, MAPILogon, and MAPILogoff. All other Simple MAPI functions that are exported by the Hmmapi.dll file return the MAPI_E_FAILURE (2) MAPI result code.
This includes the BMAPI functions, such as BMAPISendMail, which are typically exported by Simple MAPI implementations to allow Visual Basic programs to call them. The BMAPI functions use simpler structures that Visual Basic can understand. Hotmail does not implement any of the BMAPI functions. Any call to them returns with the MAPI_E_FAILURE (2) MAPI result code.
To resolve this behavior, limit the use of Simple MAPI to the MAPISendMail function and do not use the BMAPI functions if you are using Hotmail as your default e-mail client.
Hotmail provides a Simple MAPI implementation in the following file:
%Program Files%\Internet Explorer\Hmmapi.dllIf you are using Hotmail as your default e-mail client, then the following key
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail::(default)will be set to HotMail.
This causes the MAPI Stub Library (the Mapi32.dll file) to route Simple MAPI calls to the Hmmapi.dll file.
A client program can link directly to the functions in the Hmmapi.dll file by calling LoadLibrary. It is not recommended that you use this method.
The following list describes how each of the implemented Simple MAPI functions operate:
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/163216/EN-US/ )Updated Mapivb32.bas for Simple MAPI on 32-Bit Platforms
(http://support.microsoft.com/kb/315458/EN-US/ )PRB: Simple MAPI BMAPI Functions Might Not Work With MAPI Stub Library
Article ID: 315500 - Last Review: March 19, 2004 - Revision: 4.2
Contact us for more help
Connect with Answer Desk for expert help.