473,395 Members | 1,653 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,395 software developers and data experts.

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.com"
sFrom = "cr***@bonbon.com"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
oMailConfig.Fields.Update

Set objMail.Configuration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = 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 2372
Try the sample here:
http://www.aspfaq.com/2026


"crushando" <cr**********@hotmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.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.com"
sFrom = "cr***@bonbon.com"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
oMailConfig.Fields.Update

Set objMail.Configuration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = 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**********@hotmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.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.com"
sFrom = "cr***@bonbon.com"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
oMailConfig.Fields.Update

Set objMail.Configuration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = 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
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
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...
1
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...
16
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....
14
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...
24
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...
8
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...
2
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...
9
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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...

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.