473,624 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDOSYS help needed

hi

i'm new to ASP and have to deal with some email scripting at the very
start.I've collected some script pieces from a variaty of tutorial
pages but haven't been able to send any mails yet. I'm pasting the
latest version of the code:

<%

Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "te**@blabla.co m"
sFrom = "cr***@bonbon.c om"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateOb ject("CDO.Messa ge")
Set oMailConfig = Server.CreateOb ject ("CDO.Configura tion")

oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserverport" )
= 25
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpconnectiont imeout")
= 60
oMailConfig.Fie lds.Update

Set objMail.Configu ration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject = sSubject
objMail.TextBod y = sTextBody

'Send the email

objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>

As I said before i'm very new to ASP so i might be even missing a very
basic stuff. I've tried the code without the configuration part as well
but nothing has changed. Actually it seems that the problem is about
objMail.Send part. When I comment it the script runs fine but when I
activate it the page is not accessible (that's another problem that
i've come up with ASP. There's no error messages but a page error.
Should I catch an exception to see what's wrong or do I need to check
some other stuff?)
I wasn't sure about the VB syntax style so I also tried objMail.Send()
My script is running on IIS 6 server so I don't think there's a support
problem with CDOSYS

Any help and/or advise is appreciated muchly
Thanks :)

May 10 '06 #1
2 2379
Try the sample here:
http://www.aspfaq.com/2026


"crushando" <cr**********@h otmail.com> wrote in message
news:11******** **************@ j73g2000cwa.goo glegroups.com.. .
hi

i'm new to ASP and have to deal with some email scripting at the very
start.I've collected some script pieces from a variaty of tutorial
pages but haven't been able to send any mails yet. I'm pasting the
latest version of the code:

<%

Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "te**@blabla.co m"
sFrom = "cr***@bonbon.c om"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateOb ject("CDO.Messa ge")
Set oMailConfig = Server.CreateOb ject ("CDO.Configura tion")

oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserverport" )
= 25
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpconnectiont imeout")
= 60
oMailConfig.Fie lds.Update

Set objMail.Configu ration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject = sSubject
objMail.TextBod y = sTextBody

'Send the email

objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>

As I said before i'm very new to ASP so i might be even missing a very
basic stuff. I've tried the code without the configuration part as well
but nothing has changed. Actually it seems that the problem is about
objMail.Send part. When I comment it the script runs fine but when I
activate it the page is not accessible (that's another problem that
i've come up with ASP. There's no error messages but a page error.
Should I catch an exception to see what's wrong or do I need to check
some other stuff?)
I wasn't sure about the VB syntax style so I also tried objMail.Send()
My script is running on IIS 6 server so I don't think there's a support
problem with CDOSYS

Any help and/or advise is appreciated muchly
Thanks :)

May 10 '06 #2
there are a lot of different ways to send email using cdosys, these article
goes over that in detail
http://www.powerasp.com/content/new/...ail_cdosys.asp

Your just trying one... and by saying your email server is "localhost" that
may or may not be valid.

Ultimately you have to ask your server admins what settings you should be
using to send an email with CDOSYS.
If it is your local server that knowledge all rides on you.


"crushando" <cr**********@h otmail.com> wrote in message
news:11******** **************@ j73g2000cwa.goo glegroups.com.. .
hi

i'm new to ASP and have to deal with some email scripting at the very
start.I've collected some script pieces from a variaty of tutorial
pages but haven't been able to send any mails yet. I'm pasting the
latest version of the code:

<%

Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "te**@blabla.co m"
sFrom = "cr***@bonbon.c om"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateOb ject("CDO.Messa ge")
Set oMailConfig = Server.CreateOb ject ("CDO.Configura tion")

oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpserverport" )
= 25
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fie lds("http://schemas.microso ft.com/cdo/configuration/smtpconnectiont imeout")
= 60
oMailConfig.Fie lds.Update

Set objMail.Configu ration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject = sSubject
objMail.TextBod y = sTextBody

'Send the email

objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>

As I said before i'm very new to ASP so i might be even missing a very
basic stuff. I've tried the code without the configuration part as well
but nothing has changed. Actually it seems that the problem is about
objMail.Send part. When I comment it the script runs fine but when I
activate it the page is not accessible (that's another problem that
i've come up with ASP. There's no error messages but a page error.
Should I catch an exception to see what's wrong or do I need to check
some other stuff?)
I wasn't sure about the VB syntax style so I also tried objMail.Send()
My script is running on IIS 6 server so I don't think there's a support
problem with CDOSYS

Any help and/or advise is appreciated muchly
Thanks :)

May 10 '06 #3

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

Similar topics

3
4717
by: BB | last post by:
For send mail from a web page is there any benefit in using CDOSYS over CDONTS? Are the methods the same? How do you Set the object? Thanks BB
3
5857
by: Serge Myrand | last post by:
Hi everybody, The following code for sending email (found on msn I think) works find when used in a .VBS file. I double click the file and the mail is send. When I use the same code in my .ASP application I get the following message: "The pickup directory path is required and was not specified" Where to specify that directory?
1
1595
by: Paxton | last post by:
Is it necessary to set field configurations for CDOSYS? I have yet to recode all my existing uses of CDONTS over to CDOSYS. In most of the sample code I've seen on the usual ASP sites, there is code to set field configurations for CDOSYS (usually using With... End With). However, in a number of CDOSYS-related code samples offered within this news group, the field configuration code is absent.
16
3159
by: tshad | last post by:
I have both cdosys.dll and cdonts.dll on my W2K3 server. We have been told by our web authors that their asp code won't work on our machine and that we don't have CDONTS installed on our machine. They're getting an error from: Set objCDOMail = Server.CreateObject("CDONTS.NewMail") I know that the new format is:
14
13414
by: Neil Ginsberg | last post by:
I am using VBA/Access to send SMTP mail using CDO. I set a reference to "Microsoft CDO for Windows 2000 Library" (cdosys.dll). Everything works fine, both on my PC and on another PC. However, on another PC that the database was installed on, the user is getting the message, "The project contains a missing or broken reference to the file 'CDO.DLL' version 1.21." However, I don't have a reference to cdo.dll; my reference is to cdosys.dll....
24
6251
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I can't figure out how to embed an image. Thanks for your time. -- Manuel
8
7538
by: Akbur | last post by:
Dear all, I'm having major issues sending an email from my ASP.NET app. I'm getting a "Could not create 'CDO.Message' object". When I did a search for cdosys.dll in \win_location\system32, I could not find it. So I copied it from another Windows 2003 server, where it did exist. Another dependant file was missing too (inetcomm.dll).
2
5363
by: mister-Ed | last post by:
Trying to use cdosys mail, but this is giving me an "no such object" error. the hosting company is not much help, but their list of components offered does include cdosys mail: <form method="post" action="cdosys-godaddy.asp"><p class="bodymd- wh">Your Name: <input type="text" name="uname" id="uname"> <br>City: <input type="text" name="city" id="city"> <br>State:
9
3014
by: paulmitchell507 | last post by:
I have a file called email2.asp which I am using to mail data obtained from a SQL query. I would like to pass the holiday_ID value in the querystring attached to the end of the URL. It all works except that I can't get the value of holiday_ID included as a querystring. As a test I can insert a value after the ?id= and this is passed as a querystring. I am sure it's just the syntax that I am having problem with
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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
8624
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
8336
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
8478
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
7164
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...
0
4082
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...
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.