Microsoft KB Archive/305628

= You receive the &quot;Class definition MAPI.SESSION is not found&quot; 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(&quot;MAPI.Session&quot;). 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.

