473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sending mail with CDO(NTS)

1
I am not sure whether I should be using CDO or CDONTS. I am still waiting for an answer on that.

I am editing this code, trying to get it to actually send mail:
I've tried copying every suggestion I can find on how to solve to problem, but nothing seems to work.
I am really new to asp (24 hours ago..).

The error respons when I press send is
CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Armeringsservice.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"-->
</head>

<body>
<%
Dim myMail, navn, firma, mail, melding, emne, MailBody

navn=Request.Form("navn")
firma=Request.Form("firma")
mail=Request.Form("mail")
melding=Request.Form("melding")
emne=Request.Form("emne")

MailBody = "Name: " & VbCrLf
MailBody = MailBody & navn & vbCrLf & vbCrLf

Set myMail= CreateObject("CDO.Message")

myMail.To="y@y.com"
myMail.From=mail & "(" & navn & ")"
myMail.Subject="Kontaktmail : " & emne
myMail.Cc= mail
myMail.Bcc= "x@x.com"
myMail.TextBody="This is a message."

myMail.Send
set myMail = nothing
%>

</body>
Feb 6 '08 #1
1 1698
JamieHowarth0
533 Expert 512MB
Hi there,

CDO (or CDOSYS by it's full name) is the recommended object for any new classic ASP mail sending functionality. CDONTS was designed for older platforms such as WinNT, and CDOSYS is now the standard in Windows 2000, XP and Server 2003.

The SendUsing parameter has to be set to 2 (send via SMTP) like so:
Expand|Select|Wrap|Line Numbers
  1. 'Use the Sender property instead of From
  2. myMail.Sender = mail & "(" & navn & ")"
  3. myMail.Configuration.Fields.Item _
  4. ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
  5.  
  6. 'Name or IP of remote SMTP server
  7. myMail.Configuration.Fields.Item _
  8. ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.myserver.com"
  9.  
  10. 'Server port (typically 25)
  11. myMail.Configuration.Fields.Item _
  12. ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  13.  
  14. myMail.Configuration.Fields.Update
  15.  
That should do the trick for you. Let us know if it works.

Best regards,

medicineworker
Feb 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ajay | last post by:
hi i am sending the attachment using cdo nts in MIME format. The problem is that the mail is going but the attachment is not send and the message of http error 404 is shown in body of the mail....
10
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the...
4
by: Hardy | last post by:
hi gurus, now I have to backup and restore a 8 T size db2 database. from two s85 to two 670. the partitions,tablespaces of the db should be redesigned then I plan to use redirected restore. but...
3
by: icsupt via AccessMonster.com | last post by:
I would like to send an email from Access. I copied the code from another free website, but it does not do everything I need it to do. I have a series of checkboxes: checkbox1 - when checked,...
7
by: Daniel Billingsley | last post by:
I know this is slightly off topic here - but while I can find some old VB code examples, there is very little information on programming against this library with C#. Specifically , I want to...
2
by: Joey | last post by:
I am currently developing a C# asp.net application where users are required to register. The application then generates a simple, plain text email and sends it to the new user. I have been...
0
by: Shailja | last post by:
Hi, I have added reference Microsoft CDO for NTS 1.2 Library to my project. I am trying to send an Email from my system but I get the error "RUN TIME ERROR 429 - ACTIVEX COMPONENT CAN'T...
1
by: rn5a | last post by:
I am trying to send mails through ASP using CDO.MESSAGE but I don't know why I am always getting the following error message: Cannot modify or delete an object that was added using the COM+ Admin...
6
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.