Solved

Trying to use CDONTS on XP to send e-mail

Posted on 2004-08-25
6
651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 52

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 52

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month6 days, 5 hours left to enroll

627 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