Forum Moderators: open

Message Too Old, No Replies

Session variables and cdonts

Is there something wrong with this script?

         

dickbaker

6:28 pm on Feb 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to get a couple of session variables emailed to me but, no matter how I write the script for cdonts, it's not working. Can someone look at this and let me know if it's properly done, or if session variables can even be passed to a cdonts script?

Thanks in advance for any replies.

The script:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%Language="VBSCRIPT"%>
<%
cdousername = Session("username")
cdopass = Session("pass")

%>

<%
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = "me@myisp.com"
objCDO.Subject = "Dealer Updated Page"
objCDO.Body = "Username: " & cdousername & VbCrLf & "Password: " & vbCrLf & cdopass
objCDO.Send()
objCDO = null
%>
<%
Response.Redirect "dealerupdatethanks.asp"
%>
</head>

<body bgcolor="#FFFFFF" text="#000000">

</body>
</html>

macrost

12:09 am on Feb 15, 2004 (gmt 0)

10+ Year Member



dickbaker,
Sure, sessions can be used. The question is if your host or server has sessions enabled on the server. If not, I believe you can use an enable session directive at the top of your page.

Also, take the vbscript declarative and put it above your html tag. You have this: <%Language="VBSCRIPT"%> when, if memory is correct, should be this: <%@ language = "VBScript"%>

At the end of your code, there's this: objCDO = null
Try:
take out objCDO = null
and replace with the below:

objCDO.Close
Set objCDO = Nothing.

If you still have nothing, turn your friendly http errors off by going to tools -> internet options -> advanced
-> and un-check friendly http error messages.
And paste the error that you get.
Mac

Digga

8:56 am on Feb 18, 2004 (gmt 0)

10+ Year Member



Hi

You need an objCDO.From field.

Both To and From are mandatory otherwise the email will not send.