473,791 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to use CDONTS for email

I am hoping to be able to avoid the Outlook security problem by using
CDONTS and I tried using the code below (with appropriate change to
the address etc):

Dim oEMail As New CDONTS.EMail

oEMail.From "anyn...@anydom ain.com"
oEMail.To "yourem...@your domain.com"
oEMail.BodyForm at = CdoBodyFormatTe xt
oEMail.Body = "Insert some useful text here"
oEMail.Importan ce = CdoHigh
oEMail.AttachFi le "C:\filename.tx t"
oEMail.Send

There was no reference to CDO in the References so selected CDO.
Code didn't work (CDONTS.email unrecognised).

I then tried:
Sub SendEmail()
Const MailSender as String = "sender @ yourdomain.com"
Const MailRecipient as String = "recipient @ anotherdomain.c om"
Const MailCCRecipient as String = "cc @ anotherdomain.c om"
Const MailSubject as String = "Here's an email with an attachment"
Const MailBody as Strnig = "See the attachment"

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configurati on
Dim Flds as New CDO.Fields
Dim strAttachment as String

strAttachment = "C:\somefile.tx t"

With Flds
.Item(cdoSMTPSe rver) = "ip address or name of smtp server"
.Item(cdoSMTPSe rverPort) = 25 ' typically
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPCo nnectionTimeout ) = 200
.Item(cdoSMTPAu thenticate) = cdoNTLM
End With

With iMsg
Set .Configuration = iConf
.To = MailRecipient
.CC = MailCCRecipient
.From = MailSender
.Subject = MailSubject
.TextBody = MailBody
.AddAttachment (strAttachment)
.MDNRequested = True 'return receipt on
.Send
End With

End Sub

Didn't work. Stopped at the first Dim statement. I definitely have
CDO referenced.

Anyone able to help? e.g. how do I get the CDONTS method to work
(looks simpler) or what is wrong with the CDO method?

Win XP, Access 2002.

Thanks

Jeff B.
Sep 27 '08 #1
0 1593

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4707
by: | last post by:
Hi Guys CDONTS works with all sites hosted on my test server bar one (which surely rules out a miscomputation of the Default SMTP server in IIS). I have tried uploading the file with make up the site in which CDONTS to one of the IIS "sites" which is known to work with CDONTS, and still, no email received. The bad mail dir gets three files each time, the error is:
2
3637
by: David | last post by:
My email application was working a couple of weeks ago, then all of a sudden I get Error Type: (0x8009000F) Object already exists. I checked the permissions on the machinekeys directory like the KB article said it still doesn't work. Does have any ideas?
7
2547
by: Mario Leduc | last post by:
Hi, I have a page that sends user comments with CDONTS, works fine. Until I put a URL (http://192.168.0.1). If I use http://domain.com it works fine. Why with the numeric URL, CDONTS does not send the mail?? Thanks
2
3680
by: Marty | last post by:
ASP.Net, C#, Email message, CDonts not CDO I am writing an ASP.Net application where I cannot use CDO. I must use CDonts. I cannot find an example of this on the Internet. I only see examples on how to do this using CDO. Unfortunately, I don't have that option. I must use C# and CDonts. Do you have any ideas or code? In traditional ASP, the code was: objMail = Server.CreateObject("CDONTS.NewMail");
2
9387
by: microsoft.public.dotnet.languages.csharp | last post by:
ASP.Net, C#, Email message, CDonts not CDO I am writing an ASP.Net application where I cannot use CDO. I must use CDonts. I cannot find an example of this on the Internet. I only see examples on how to do this using CDO. Unfortunately, I don't have that option. I must use C# and CDonts. Do you have any ideas or code? In traditional ASP, the code was: objMail = Server.CreateObject("CDONTS.NewMail"); objMail.To =...
4
2070
by: Dr. Harvey Waxman | last post by:
I guess I should change from cdonts to cdosys. Since I am ignorant about asp I hope you forgive this basic question. There are two asp files for handling mail, the one that gets the info from a form and creates a form.asp to mail and the one that takes that file and mails it, mail.asp. I believe I can figure out what needs to be altered in the code for the first form.asp but what needs to be changed in the one that sends the email? Is...
4
1647
by: Giorgio | last post by:
Hi, I'm working on this web space: NT4/Windows 98, Microsoft-IIS/4.0, 66.71.142.204 I can't send mail with CDO cause i get an error http://66.71.142.204/ASWebNews/newsletters/mail.asp <% Set myMail = CreateObject("CDO.Message") myMail.Subject = "eeeSending email with CDO" myMail.From = "mymail@mydomain.myext" myMail.To = "mymail@mydomain.myext"
7
2890
by: Paul | last post by:
I have just started work on a system using CDONTS to mail out. Whilst this is fine on the server, my local development machine is using XP Pro with IIS5.1 installed. Is there a way I can get the functionality of cdonts so that I can test/develop on my local machine, preferably without actually sending any mail to the persons involved.
6
2941
by: jbguernsey | last post by:
for: There was no reference to CDO in the References so selected CDO. Code didn't work (CDONTS.email unrecognised). read There was no reference to CDONTS in the References so selected CDO. Code didn't work (CDONTS.email unrecognised).
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.