Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a CDO.messageobject to send email

Status
Not open for further replies.

JBalcerzak

Programmer
Sep 5, 2002
73
US
I'm trying to instantiate a message object:

oMsg = CreateObject("CDO.message")

but each time I do, I'm getting a message that Class definition CDO.MESSAGE is not found...

I've run the regsvr32 cdo.dll and it comes back that its registered successfully, but I still can get it to work...

Any ideas?

p.s. Using VFP 6.0 in Win98

Thanks
 
JBalcerzak

Works for me (VFP6.0 & VFP7.0 and '98)
Here are the requirements for using CDO:

Software Requirements
The dynamic-link libraries for CDO (CDO.DLL) and CDO Rendering (CDOHTML.DLL) are MAPI client object libraries. As such, they require MAPI (the version of MAPI32.DLL installed with Microsoft® Exchange Server version 5.0, or above) and service providers — for example, the same service providers as with Microsoft Exchange Server. CDOHTML.DLL and CDO.DLL are included with Microsoft Exchange Server and are installed on the server when the installation option Active Server Components is selected.

You can also use CDO (CDO.DLL only, not CDOHTML.DLL) after installing the Windows Messaging client included with Microsoft® Windows® 95 and Microsoft® Windows NT® version 4.0. CDO Rendering (CDOHTML.DLL) is intended for server-side use only.

Although CDO works with Microsoft® Outlook™, CDO.DLL is not installed with the Outlook setup program. You can set up CDO after setting up Microsoft Outlook by installing the library on its own or by installing the Microsoft Exchange Server 5.0 client. (You can install the CDO libraries independently by copying them from the installation CD-ROM to your computer's system directory.)


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
I'm still not able to get this to work very well... I made sure I ran the CDO installer from my outlook 2000 cd. I've got the Mapi32.dll on my machine but not the CDOHTML.dll file. Still getting "Class Definition CDO.message is not found" at the oMsg = CreateObject("CDO.message") line. Do I need to do something special in VFP to register the dll - did the regsvr32 already...
 
JBalcerzak

Do I need to do something special in VFP to register the dll - did the regsvr32 already...

No, not in VFP. Does your CDO.dll come alone or with an install. I mean I installed mine from an XP cd (as a seperate install), but after I installed it, I didn't have to register it, the install procedure registered it.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
JBalcerzak

Sorry, I didn't want to mislead you, but the CDO.dll (and associated files), I installed them from my Office XP CD. The option is called "Collaboration data objects", under the Microsoft Outlook otions and it does not install automatically, you have to specify it. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Yes - I installed the Collaboration Data Objects off the Office 2000 cd yesterday - I selected the option "run all from my computer". I am able to use the Mapi ActiveX controls to basic emails fine, but I'm trying to do something a little fancier and faq184-1768(?) has a nice example of using the HTMLbody property.
 

Yes - I installed the Collaboration Data Objects off the Office 2000 cd yesterday - I selected the option "run all from my computer".

Ok, so after that install, it does not work? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Yes - its the strangest thing. I've tried this a few times a few different ways and I still get the error message "Class definition CDO.message is not found" when I try to instantiate it:

oMsg = CreateObject("cdo.message")

I have had success with the class library from West-Wind - I can instantiate the ipstuff class and use that nicely - the CDO stuff just looked a little cleaner...
 
JBalcerzak

The only thing I can suggest is to try to uninstall the CDO and re-install it, and see if that helps. I have it on three computers and they all worked on first install. BTW other then the FAQ I wrote on CDO there are quite a few samples in the CDO help file (Although the examples are in VB code, it's easily translatable) Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
I'll have to look at that - I know things are a little different in VB, but I'll give it a try. With the particular app I've got in mind - broadcasting an html email on an opt-in list for a weekly newsletter - I think VFP might be the way to go, as I can connect our customer database which is in a VFP table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top