473,722 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDOSYS send email with ASP

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
<%
Option Explicit
<!--#include file="admin_nav igation.asp" -->

'Declare variables
Dim sch, cdoConfig, cdoMessage, holiday_ID, email, auth
holiday_ID = Request.Form("m yname")
sch = "http://schemas.microso ft.com/cdo/configuration/"

Set cdoConfig = CreateObject("C DO.Configuratio n")

With cdoConfig.Field s
'Set CDO Port
.Item(sch & "sendusing" ) = 2
'Set mailserver name either IP address, mail.yoursite.c om or
localhost
.Item(sch & "smtpserver ") = "192.156.21 7.6"
'Set SMTP port which is 25 by default
.Item(sch & "smtpserverport ") = 25
'Set number of seconds before timeout
.Item(sch & "smtpconnection timeout") = 60
.update
End With

Set cdoMessage = CreateObject("C DO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "ad***********@ domain.com"
.To = "pa**@ndomani.c om"
.Subject = ""& email
'Send the email in HTML format
.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?
id=holiday_ID'> delete record</a><br><br>"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
Jul 31 '08 #1
9 3027
paulmitchell507 wrote on 31 jul 2008 in
microsoft.publi c.inetserver.as p.general:
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
.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?
id=holiday_ID'> delete record</a><br><br>"
In your example
part of a string sould automagically change into the value of a variable?

If you think that is possible, it would seem you have no idea what
programming is about.

Try:

..HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&_
holiday_ID & "'>delete record</a><br><br>"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 31 '08 #2
On Jul 31, 2:50*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
paulmitchell507 wrote on 31 jul 2008 in
microsoft.publi c.inetserver.as p.general:
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
* * * * .HTMLBody = "<a href='http://192.156.217.134/authorise.asp?
id=holiday_ID'> delete record</a><br><br>"

In your example
part of a string sould automagically change into the value of a variable?

If you think that is possible, it would seem you have no idea what
programming is about.

Try:

.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&_
*holiday_ID & "'>delete record</a><br><br>"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
You are correct, I know very little about programming, hence why I
have posted the question. Maybe I have not explained myself very
well. If insert the following code
HTMLBody = "<a href='http://192.156.217.134/authorise.asp'> delete
record</a><br><br>"
The user will receive a hyperlink called 'delete record' which will
take them to my authorise.asp page.
All I want to do is add my variable, holiday_ID to the string, a bit
like response.write "my holiday id is" & holiday_ID
So when the user activates the link, the user gets directed to the asp
page with the holiday_ID as a querystring. I can then use the
holiday_ID value in the authorise.asp page.

Jul 31 '08 #3
paulmitchell507 wrote on 31 jul 2008 in
microsoft.publi c.inetserver.as p.general:
>Try:

.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&_
˙holiday_ID & "'>delete record</a><br><br>"
[please do not quite signatures on usenet]
>
You are correct, I know very little about programming, hence why I
have posted the question. Maybe I have not explained myself very
well. If insert the following code
HTMLBody = "<a href='http://192.156.217.134/authorise.asp'> delete
record</a><br><br>"
The user will receive a hyperlink called 'delete record' which will
take them to my authorise.asp page.
All I want to do is add my variable, holiday_ID to the string, a bit
like response.write "my holiday id is" & holiday_ID
So when the user activates the link, the user gets directed to the asp
page with the holiday_ID as a querystring. I can then use the
holiday_ID value in the authorise.asp page.
.... and my example above does not do that?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 31 '08 #4
On Jul 31, 4:26*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
paulmitchell507 wrote on 31 jul 2008 in
microsoft.publi c.inetserver.as p.general:
Try:
.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&_
˙holiday_ID & "'>delete record</a><br><br>"

[please do not quite signatures on usenet]
You are correct, I know very little about programming, hence why I
have posted the question. *Maybe I have not explained myself very
well. *If insert the following code
HTMLBody = "<a href='http://192.156.217.134/authorise.asp'> delete
record</a><br><br>"
The user will receive a hyperlink called 'delete record' which will
take them to my authorise.asp page.
All I want to do is add my variable, holiday_ID to the string, a bit
like response.write "my holiday id is" & holiday_ID
So when the user activates the link, the user gets directed to the asp
page with the holiday_ID as a querystring. *I can then use the
holiday_ID value in the authorise.asp page.

... and my example above does not do that?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dear Evertjan
Sorry, I did not see your example code in the previous post. Thank
you very much for taking the time to help me, the following code works

.HTMLBody = "<a href='http://192.x.x.x/authorise.asp?i d="& email
&"'>delete record</a><br><br>"

Paul
PS Maybe you could assist me in the future...I am sure I am going to
need it!
Aug 1 '08 #5
paulmitchell507 wrote on 01 aug 2008 in
microsoft.publi c.inetserver.as p.general:
On Jul 31, 4:26*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
>paulmitchell50 7 wrote on 31 jul 2008 in
microsoft.publ ic.inetserver.a sp.general:
>Try:
>.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&
_
>˙holiday_ID & "'>delete record</a><br><br>"

[please do not quite signatures on usenet]
You are correct, I know very little about programming, hence why I
have posted the question. *Maybe I have not explained myself very
well. *If insert the following code
HTMLBody = "<a href='http://192.156.217.134/authorise.asp'> delete
record</a><br><br>"
The user will receive a hyperlink called 'delete record' which will
take them to my authorise.asp page.
All I want to do is add my variable, holiday_ID to the string, a
bit like response.write "my holiday id is" & holiday_ID
So when the user activates the link, the user gets directed to the
asp page with the holiday_ID as a querystring. *I can then use the
holiday_ID value in the authorise.asp page.

... and my example above does not do that?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Dear Evertjan
Sorry, I did not see your example code in the previous post. Thank
you very much for taking the time to help me, the following code works

.HTMLBody = "<a href='http://192.x.x.x/authorise.asp?i d="& email
&"'>delete record</a><br><br>"

Paul
PS Maybe you could assist me in the future...I am sure I am going to
need it!
Only if you read the responses completely, as I nearly wrote:
"[please do not quote signatures on usenet]"
and you did not follow that Netiquette advice.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 1 '08 #6
On Aug 1, 2:03*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
paulmitchell507 wrote on 01 aug 2008 in
microsoft.publi c.inetserver.as p.general:


On Jul 31, 4:26*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
paulmitchell507 wrote on 31 jul 2008 in
microsoft.publi c.inetserver.as p.general:
Try:
.HTMLBody = "<a href='http://192.156.217.134/authorise.asp?i d="&
_
˙holiday_ID & "'>delete record</a><br><br>"
[please do not quite signatures on usenet]
You are correct, I know very little about programming, hence why I
have posted the question. *Maybe I have not explained myself very
well. *If insert the following code
HTMLBody = "<a href='http://192.156.217.134/authorise.asp'> delete
record</a><br><br>"
The user will receive a hyperlink called 'delete record' which will
take them to my authorise.asp page.
All I want to do is add my variable, holiday_ID to the string, a
bit like response.write "my holiday id is" & holiday_ID
So when the user activates the link, the user gets directed to the
asp page with the holiday_ID as a querystring. *I can then use the
holiday_ID value in the authorise.asp page.
... and my example above does not do that?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dear Evertjan
Sorry, I did not see your example code in the previous post. *Thank
you very much for taking the time to help me, the following code works
.HTMLBody = "<a href='http://192.x.x.x/authorise.asp?i d="& email
&"'>delete record</a><br><br>"
Paul
PS Maybe you could assist me in the future...I am sure I am going to
need it!

Only if you read the responses completely, as I nearly wrote:
"[please do not quote signatures on usenet]"
and you did not follow that Netiquette advice.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text -

- Show quoted text -
Ok, no signatures!
My next problem (again simple to solve if you have the knowledge)
regarding CDOSYS. The CDOSYS script is located on email.asp,
surrounded by the delimiters <% and %>. I would like to run the
CDOSYS script and then use a SQL insert command to update the
database. At the monent, I cant get the email.asp page to do anything
other than run the CDOSYS script.
Aug 1 '08 #7
paulmitchell507 wrote on 01 aug 2008 in
microsoft.publi c.inetserver.as p.general:
>Only if you read the responses completely, as I nearly wrote:
"[please do not quote signatures on usenet]"
and you did not follow that Netiquette advice.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text
-

- Show quoted text -

Ok, no signatures!
You misunderstand. Your signature should be there,
but there is no reason to QUOTE mine(!) in your(!) posting.
My next problem (again simple to solve if you have the knowledge)
How would you know?
regarding CDOSYS. The CDOSYS script is located on email.asp,
surrounded by the delimiters <% and %>. I would like to run the
CDOSYS script and then use a SQL insert command to update the
database. At the monent, I cant get the email.asp page to do anything
other than run the CDOSYS script.
There is no "CDOSYS script" as such, there is ASP-vbscript or
ASP-jscript between the <% and the %>, that is executed by and on the
server.

CDOSYS commands can be inserted in such scripts, if you want that email
functionality used. I myself use Jmail instead. The scripting can be
done in any .asp file, the name email.asp is just the name the
programmer that wrote your page gave to the page file, and it could have
included other functionality as well.

So if you want to add or change functionality, there are two options:

1 You learn to programme in ASP-vbs and/or ASP-jscript, and programme
yourself. If you get into trouble, we will be here to help you, but we
will not do the task for you, see 2.

2 You let someone else do the task. Usually you pay such programmer for
his work.

A good start for learning would be to read the archives of this NG, or
to search for ASP tutorials on Google.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 1 '08 #8
On Aug 1, 4:13*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
paulmitchell507 wrote on 01 aug 2008 in
microsoft.publi c.inetserver.as p.general:
Only if you read the responses completely, as I nearly wrote:
"[please do not quote signatures on usenet]"
and you did not follow that Netiquette advice.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text
-
- Show quoted text -
Ok, no signatures!

You misunderstand. Your signature should be there,
but there is no reason to QUOTE mine(!) in your(!) posting.
My next problem (again simple to solve if you have the knowledge)

How would you know?
regarding CDOSYS. *The CDOSYS script is located on email.asp,
surrounded by the delimiters <% and %>. *I would like to run the
CDOSYS script and then use a SQL insert command to update the
database. *At the monent, I cant get the email.asp page to do anything
other than run the CDOSYS script.

There is no "CDOSYS script" as such, there is ASP-vbscript or
ASP-jscript between the <% and the %>, that is executed by and on the
server.

CDOSYS commands can be inserted in such scripts, if you want that email
functionality used. I myself use Jmail instead. The scripting can be
done in any .asp file, the name email.asp is just the name the
programmer that wrote your page gave to the page file, and it could have
included other functionality as well.

So if you want to add or change functionality, there are two options:

1 You learn to programme in ASP-vbs and/or ASP-jscript, and programme
yourself. If you get into trouble, we will be here to help you, but we
will not do the task for you, see 2.

2 You let someone else do the task. Usually you pay such programmer for
his work.

A good start for learning would be to read the archives of this NG, or
to search for ASP tutorials on Google.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Forget my last post!
I was looking at the wrong asp page. The SQL INSERT command was not
working because I had not not written it correctly. I have everything
working except for one last task. I will do a bit more research
before posting for help!
Aug 4 '08 #9
On Aug 4, 2:19*pm, paulmitchell507 <paulmitchell.. .@googlemail.co m>
wrote:
On Aug 1, 4:13*pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:


paulmitchell507 wrote on 01 aug 2008 in
microsoft.publi c.inetserver.as p.general:
>Only if you read the responses completely, as I nearly wrote:
>"[please do not quote signatures on usenet]"
>and you did not follow that Netiquette advice.
>--
>Evertjan.
>The Netherlands.
>(Please change the x'es to dots in my emailaddress)- Hide quoted text
>-
>- Show quoted text -
Ok, no signatures!
You misunderstand. Your signature should be there,
but there is no reason to QUOTE mine(!) in your(!) posting.
My next problem (again simple to solve if you have the knowledge)
How would you know?
regarding CDOSYS. *The CDOSYS script is located on email.asp,
surrounded by the delimiters <% and %>. *I would like to run the
CDOSYS script and then use a SQL insert command to update the
database. *At the monent, I cant get the email.asp page to do anything
other than run the CDOSYS script.
There is no "CDOSYS script" as such, there is ASP-vbscript or
ASP-jscript between the <% and the %>, that is executed by and on the
server.
CDOSYS commands can be inserted in such scripts, if you want that email
functionality used. I myself use Jmail instead. The scripting can be
done in any .asp file, the name email.asp is just the name the
programmer that wrote your page gave to the page file, and it could have
included other functionality as well.
So if you want to add or change functionality, there are two options:
1 You learn to programme in ASP-vbs and/or ASP-jscript, and programme
yourself. If you get into trouble, we will be here to help you, but we
will not do the task for you, see 2.
2 You let someone else do the task. Usually you pay such programmer for
his work.
A good start for learning would be to read the archives of this NG, or
to search for ASP tutorials on Google.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Forget my last post!
I was looking at the wrong asp page. *The SQL INSERT command was not
working because I had not not written it correctly. *I have everything
working except for one last task. *I will do a bit more research
before posting for help!- Hide quoted text -

- Show quoted text -
Ok, I think I am trying to doing something that is very simple,
inserting the results of a SQL query into an existing table in my
access DB.

uSQL = "SELECT cal_date, holiday_ID from Calendar, holiday_tbl WHERE
(((calendar.cal _Date) Between [holiday_tbl].[startdate] And
[holiday_tbl].[enddate])) And Email_sent=0 AND Staff_ID=" & Staff_ID

The query returns a holiday_ID and a cal_date for each record if finds
that matches the criteria. I can test the results my adding the
following,

If recordset.EOF Then
Response.write "<div align='centre'> Sorry no holidays found</div>"
Else
Do while not recordset.Eof
response.write recordset("holi day_id") & " " & recordset("cal_ date") &
" "
recordset.moven ext
Loop
End If

My question is simple, how can I insert the results into an existing
table named holiday_dates? The table has 2 fields, holiday_ID and
cal_date.

Regards, Paul

Aug 5 '08 #10

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

Similar topics

21
4008
by: tp | last post by:
HI..... I have made simpale web site inside that i am generating email page which send form as email. i have setup small business server with Exchange server 2003 and i have hosted my website with this server. i can not generate email using following code while same code working with my developement XP machine installed SMTP service.
9
2702
by: tshad | last post by:
This is a problem that we saw before on our asp site, but don't know how to fix it. We are seeing it on our .net site also. We have our email sending from our Windows 2003 server with exchange fine, unless we send to an alias. It never gets there. I can send directly and it works fine and the CDOSYS works fine to a non-alias account.
2
2386
by: crushando | last post by:
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
24
6269
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
9
3017
by: RedMoosh | last post by:
is it possible to rn a client side vbscript to send messages using cdo.message and cdo.configuration? what are the requirements to do this? my wks are xp and 2000 and all have cdosys.dll registered. do i have to have outlook express loaded. i have workstations that don't have outlook but rather lotus notes and want to send email to an smtp server. these emails have local attachment thus the need to run client script versus server...
8
7544
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
5366
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:
1
1378
by: worldofrugs | last post by:
I'm hosted on a shared server with Godaddy.com... I have several forms on my website that all use the same ASP file to send out my forms.. It worked fine for a long time, but now the forms send to my e-mail arrive after a few hours instead of instantly. Calling Godaddy did not help as they stated all is working fine (no delays) on their end and refuse to help with custom scripts.. My emails are also hosted by godaddy like my website. ...
4
7212
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am working on a program that gets mail messages from the default SMTP server with iis 6.0 on windows server 2003. I am using the cdosys.dll in the system32 directory. The reference Name is "Microsoft CDO for Windows 2000 Library". On the machine there is a CDO.dll in the Program Files\Common Files\System\MSMAPI\1033 directory. The question is which one of these is the current dll. I also wonder if there is better way to access...
0
8738
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
9381
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
9234
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...
0
9086
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...
1
6680
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
4501
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...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2146
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.