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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO Email, stumbling with connection

Status
Not open for further replies.

operaguy

Programmer
Aug 19, 2002
28
US
Attempting to use Mike Gagnon's code from the FAQ:

oMSG = createobject("CDO.Message")
oMSG.To = "john@jrdonohue.com"
oMSG.From = "education@pauldonohuepresents.com"
oMSG.Subject = "Hello Email"
oMSG.HTMLBody = [< b >< P >< FONT COLOR=&quot;#CC0000&quot; >Hello In Color< /FONT >< /b >]
oMSG.Send()

Begins to execute, then error message:
OLE IDispatch exception code 0 from CDO.message.1: The transport failed to connect to the server.

I am in XP Home, not Pro, is that the problem? Outlook 2002 is mail client. That 'education' in email address is valid account. VFP 7.00. Other Fox to email ideas found in this forum working.
 
operaguy

Is it possible that you do not have CDO.dll installed on your system?
Do a search for CDO.dll, CDO32.dll, CDOex.dll.
They are available from Microsoft Office XP (And 2000) and Microsoft Exchange. Mike Gagnon

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

thought of the same thing..you need the CDO files.

found this on another forum group..


i've pasted the relevent post.

-- my paste
&quot;

Lion Shi [@online.microsoft.com]
Hello Jonny,

Based on the description of the exception, it seems that the CDO are not
installed on your Windows XP system (after Windows 2000 we do not ship CDO
by default). You may install corresponding products (such as Office XP and
Exchange) that will bring CDO onto your machine. I suggest you test your
code on a machine with such products.

I hope this helps you.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
&quot; --< end of my paste

monkey
 
My search yielded nothing for the first two, but found CDOEX.DLL at:

C:\Program Files\Common Files\Microsoft Shared\CDO

Does that mean it is installed, or might it be merely on my HD but not actually active?

This is WinXP on a 2.4 GigHz Pentium4

Thanks for your help with this fairly newbie/primitive difficulty. I don't even know what CDO stands for, or what sort of 'application' it is.

John Donohue
 
Thanks for your help with this fairly newbie/primitive difficulty. I don't even know what CDO stands for, or what sort of 'application' it is.

CDO = Collaboration Data Objects. Its just a few DLLs that allow to do certain things, like sending a e-mail.
Do you have Microsoft Office XP? If so its a separate install on it.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
By the error &quot;OLE IDispatch exception code 0 from CDO.message.1: The transport failed to connect to the server.&quot;

CDO is instantiating properly, an is therefore installed. However, when it tries to connect to the Server, it fails.

Does the Outlook email client seem to work fine?

If so, the default MAPI email client may not be Outlook... Are any other email clients installed? Do they work right?

CDO is just an interface through MAPI to an installed email client.
 
wgcs,
I only use Outlook for email. I don't believe any other client was EVER on this computer, with the possible exception of Outlook Express (if that is even different), I installed office 2000 right after building the system. I use Outlook agressively, emailing customers all day long, Outlook working perfectly. I am efaxing through Outlook and email merging with Word/Excel out to Outlook outbox.

1) However, how do I determine positively that Outlook is my default email client? Before I wrote this I did attempt to find that setting, to no avail. Sorry for Windows newbie-level question.

2) Could this be an error with my outgoing SMTP server at my ISP?

John Donohue
 
It could be a problem with the SMTP server; Perhaps it was slow when you were testing and just didn't connect.

I don't have Outlook installed to look to see if it has settings to turn MAPI support on/off or to make it the default Mapi client.

Outlook Express is a completely different program from Outlook, but I don't think it supports MAPI (I could be wrong). If it does support MAPI, then it might still be the default MAPI client, and if it's not setup with the right SMTP server, etc, it may be the problem.

( I took offense at Microsoft's trying to use Outlook Express/Outlook together (looking like one product while actually being two), to kill off all Newsgroup Readers, Email Clients, Lotus Notes, WinFax, and all other Message Related programs with one &quot;Killer App&quot;, so I refuse to use it at all. )
 
operaguy and wgcs


CDO is instantiating properly, an is therefore installed. However, when it tries to connect to the Server, it fails.

My search yielded nothing for the first two, but found CDOEX.DLL at:


That to me means CDO is not installed.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, Are you sure that all three are required?

From what I could tell, reading on MSDN, the CDO objects are installed with Outlook 98 and newer, or MS Exchange Server, or MS Exchange Client.

It would be feasible that the files CDO.dll, CDO32.dll, CDOex.dll overlap in functionality; CDOex.dll would seem to be associated with Exchange.

I wonder if the user has the option to not install CDO while installing the above applications?

This is why I lean away from using CDO activeX, or MAPI activeX, but just having the user type in the SMTP server and talk directly to the server.
See:
 
wgcs

I think that you are right in saying CDOex.dll is for Exchange, but as far as I see that is what I have on my system and it works, if opareguy is missing 2 files out of three I would guess that therein lies the problem. I've been throught this a few months ago with another member. Once the thre files were in place, things seem to function correctly. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
had to abandon work on this issue all day today. Am now going to make sure CDO is fully installed. Will report back.

[I really need to send emails out of VFP. They must be HTML with live links. Word/Excel merge has stupendous major flaw, when you compose a letter with links and merge to email, the html formatting goes over and out Outlook, but links to URLs are converted to flat text, no hyperlink. I have been told this is a know problem, find it hard to believe. No Tek-Tip reponse to my post on this yet.]
 
Hi,

I have read all arguments and suggestions but still no progress.

I am having similar problem with above code. On Windows 2000 & Outlook 2000 it works fine but on XP & Outlook 2002 it doesn't. Yes, I have checked that all three dll's are installed. Still I get following message;

OLE lDispatch exception code 0 from CDO.Message.1: The &quot;SendUsing&quot; configuration value is invalid

I don't think it matters but you never know. The location of these dll's is not the same.
Does it matter where these dll's reside?

Currently Installed on C:\Program Files\Common Files\..

..System\Mapi\1033\CDO.dll
..Crystal Decisions\1.0\Bin\CDO32.dll
..Crystal Decisions\1.0\Bin\CDOex.dll

 
It turns out that after testing these files and playing around with these CDO type files (by renaming indidual files and testing the code), the one that makes the code work properly is CDOEX.DLL (File version 6.0.4641.0). If you rename that file the code will not work.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I'm a little embarrassed to ask....(I should know how to do this)

I have found the cdo.dll on my Office 2000 disk, copied it to my \dlls subdirectory....

... now ... how do I install the dll ....

JF
 
FoxEgg

... how do I install the dll ....

??? regsvr32 c:\mydirectory\cdo.dll

In the Start->Run
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Well this is weird !!!

First the good news... thanks Mike for the .dll registration tip....

I found CDO.dll on my Office 2000 Disk, I copied to a directory in VFP and

I removed the three question marks ??? (mentioned in your tip) and it ran

regsvr32 c:\mydirectory\cdo.dll

From the Start->Run box.... It registered... (and XP Pro gave me a little pat on the back)

BUT....

the VFP-CDO email program STILL did not work immediately

SO

I needed to re-boot (XP Pro) and it then worked fine on may occasions....BUT plese be aware of the following notes..



*Mike Gagnon's CDO e-mail

*!* How to send e-mail Automating CDO
*!* faq184-1768

*/*CDO.dll comes with Windows 2000 and XP

oMSG = CREATEOBJECT(&quot;cdo.message&quot;)
oMSG.To = &quot;friendsemail@yadeyaya.com&quot;
oMSG.From = &quot;myemail@anotherplace.com&quot;
oMSG.Subject = &quot;Hello Email 1&quot;
oMSG.TextBody = &quot;This is an easy way to create an email&quot;
oMSG.Send()


this worked BRILLIANTLY !!!! on several occasions

Then I tried......the other options in Mike's FAQ... and played and played

And then got then error message:
OLE IDispatch exception code 0 from CDO.message.1: The transport failed to connect to the server.

Sounds familiar !!!!

Then I cannot even get the basic CDO e-mail code to work !!!

It did not like this line....
oAtt=oMSG.AddAttachment(“c:\textfile.doc”) &&&<<<<---


It said &quot;unrecognised phrase&quot;

So I changed it to

oAtt=oMSG.AddAttachment('c:\textfile.doc') & ' not &quot;

It ran...

So for those of you with problems...

Try a re-boot
Try a re-install
Try a change of parentheses
Try re-nstalling cdo.dll

I suspect that CDO is a little tempramental beastie.. but it is neat and easy.

JF


And if all else fails.... I suggest Chateau La Fite 1967...
 
John

Thanks for the correction in the code. I have amended the FAQ.
Chateau Haut Brion '65 Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
After you CREATEOBJECT(&quot;cdo.message&quot;) ... use it and it is done .... do you think there is a need to Release the Object ??

JF

 
John

Always a good habit to do &quot;garbage collection&quot;. If a local variable, not necessary, but public yes. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top