Microsoft KB Archive/305628

From BetaArchive Wiki
Knowledge Base


You receive the "Class definition MAPI.SESSION is not found" error message when you use CREATEOBJECT to send e-mail messages from Visual FoxPro applications

Article ID: 305628

Article Last Modified on 1/25/2005



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 3.0b Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft Visual FoxPro 7.0 Professional Edition
  • Microsoft Visual FoxPro 8.0 Professional Edition
  • Microsoft Visual FoxPro 9.0 Professional Edition



This article was previously published under Q305628

SYMPTOMS

When sending e-mail messages from Visual FoxPro applications, programmers usually use CREATEOBJECT("MAPI.Session"). Under some circumstances, however, this may return the following error messages:

Class definition MAPI.SESSION is not found

-or-


OLE error code: 0x8007007e Specified module cannot be found.

CAUSE

The most likely cause of these errors is that the Collaboration Data Objects (CDO) library is not installed. Although CDO ships with Microsoft Outlook 98 and later, it is not installed by default.

Another possible cause is that Outlook is installed in Internet Mail Only (IMO) mode. MAPI and CDO are not supported in this mode.

RESOLUTION

If you already have Outlook 98 or later installed, and Outlook is not installed in IMO mode, you can install the CDO library by rerunning the Outlook setup program and explicitly including CDO. If installing Outlook is not possible, see the following article in the Microsoft Knowledge Base:

171440 Where to acquire the CDO libraries (all versions)


If the CDO libraries are already installed and are not working, try using RegSvr32 to reregister them. For example, the following command line would work on Microsoft Windows 2000:

RegSvr32 c:\WINNT\system32\cdonts.dll


If this fails, contact Microsoft for further support.

REFERENCES

For additional information about Collaboration Data Objects, click the following article numbers to view the articles in the Microsoft Knowledge Base:

272402 General information about CDO


262701 Developer information about the Outlook e-mail security update


252720 MAPI and CDO are not supported in Outlook IMO mode


254458 Windows 2000 does not include Windows Messaging by default


Keywords: kbbug kbvfp500afix kbprb KB305628