Solved

Trying to use CDONTS on XP to send e-mail

Posted on 2004-08-25
6
645 Views
Last Modified: 2010-08-05
I am trying to use CDONTS to send emails without using outlook etc.

When I try to instantiate the object I get the following:
Runtime Error '-2147024770 (8007007e)':
Automation error
The specified module could not be found

from this code:
Dim objNewMail As Object
Set objNewMail = CreateObject("CDONTS.NewMail")

I have tried to unregister the CDONTS.DLL to try and re-register it but get the following error:
Loadlibrary("C:\windows\system32\cdonts.dll") failed. The specified module could not be found

Can anyone help me here?
0
Comment
Question by:yvsupport
6 Comments
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11891112
I am not sure, but I think that you need CDO.dll and GAPI32.DLL
0
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 125 total points
ID: 11891202
Try use CDOSYS instead, here is an example:

<%
Dim MyMail
Set MyMail = CreateObject("CDO.Message")
MyMail.From = "sender@yourdomain.com"
MyMail.To = "receiver1@domain.com"
MyMail.Cc = "receiver2@domain.com;receiver3@domain.com"
MyMail.Bcc = "receiver4@domain.com"
MyMail.Subject = "my subject"
MyMail.TextBody = "Hello world... "
MyMail.AddAttachment "c:\test.gif"
MyMail.Send()
Set MyMail = Nothing
%>
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 11891239
See explaination and suggested solution by amit_g and GaryC123 at: http:Q_20649064.html

GaryC123 wrote:

Cdonts doesn't come with XP!
You can get a copy of it here
http://dll.yaroslavl.ru/index.php3?lng=&in_char=C

and then in a dos prompt type

regsvr32 C:\windows\SYSTEM32\cdonts.dll
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:yvsupport
ID: 11893588
I am having trouble unregistering the cdonts.dll and then re-registering it....

I have also tried the CDOSYS method and whilst the code runs, I get no mail received. Do I have to configure anything?
0
 
LVL 14

Assisted Solution

by:aelatik
aelatik earned 125 total points
ID: 11895031
Yes you need to configure CDO first, add this to ryancys's post.

Set CON = CreateObject("CDO.Configuration")
        CON.Fields("cdo/configuration/smtpserver">http://schemas.microsoft.com/cdo/configuration/smtpserver") = "255.255.255.255"
        CON.Fields("cdo/configuration/smtpserverport">http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        CON.Fields("cdo/configuration/sendusing">http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        CON.Fields("cdo/configuration/smtpconnectiontimeout">http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
        CON.Fields.Update
Set MyMail.Configuration = CON

So it would be like this :

Dim MyMail
Set MyMail = CreateObject("CDO.Message")
Set CON = CreateObject("CDO.Configuration")
        CON.Fields("cdo/configuration/smtpserver">http://schemas.microsoft.com/cdo/configuration/smtpserver") = "255.255.255.255"
        CON.Fields("cdo/configuration/smtpserverport">http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        CON.Fields("cdo/configuration/sendusing">http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        CON.Fields("cdo/configuration/smtpconnectiontimeout">http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
        CON.Fields.Update
Set MyMail.Configuration = CON
MyMail.From = "sender@yourdomain.com"
MyMail.To = "receiver1@domain.com"
MyMail.Cc = "receiver2@domain.com;receiver3@domain.com"
MyMail.Bcc = "receiver4@domain.com"
MyMail.Subject = "my subject"
MyMail.TextBody = "Hello world... "
MyMail.AddAttachment "c:\test.gif"
MyMail.Send()
Set MyMail = Nothing

Good luck,
Ayhan Elatik
0
 

Author Comment

by:yvsupport
ID: 11989362
Working.

Will split the points between ryancys and aelatik

half each.

cheers guys.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question