Forums
This topic is locked
CDO Mail - where should it go?
Posted 21 Sep 2004 22:15:10
1
has voted
21 Sep 2004 22:15:10 shaun carter posted:
I have attched some script below and marked it with a <img src=../images/dmxzone/forum/icon_smile_question.gif border=0 align=middle> where I was told my cdo script should go, I have tried but I don't get any mail??Any suggestions?
Thanks
Shaun
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/mswdb.asp" -->
<!--#include file="../ScriptLibrary/incResizeAddOn.asp" -->
<!--#include file="../ScriptLibrary/incPureUpload.asp" -->
<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
'*** Pure ASP File Upload 2.1.8
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload"


Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """../uploads"""
pau_Extensions = "GIF,JPG,JPEG"
pau_Form = "form1"
pau_Redirect = ""
pau_storeType = "path"
pau_sizeLimit = "300"
pau_nameConflict = "uniq"
pau_requireUpload = "false"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = ""
pau_progressWidth = "300"
pau_progressHeight = "100"
Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.18
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
</SCRIPT>
<%
// *** Smart Image Processor 1.1.2
if (String(Request.QueryString("GP_upload"


var RUF_Component = "ASP.NET"
var RUF_DotNetResize = "../ScriptLibrary/ResizeImage.aspx"
var RUF_ResizeImages = true
var RUF_AspectImages = true
var RUF_maxWidth = 400
var RUF_maxHeight = 300
var RUF_Quality = 80
var RUF_MakeThumb = true
var RUF_AspectThumb = true
var RUF_Suffix = "_small"
var RUF_maxWidthThumb = 100
var RUF_maxHeightThumb = 80
var RUF_QualityThumb = 70
var RUF_RedirectURL = ""
if (RUF_ResizeImages)
ResizeUploadedFiles(RUF_Component, RUF_DotNetResize, pau_thePath, "", RUF_maxWidth, RUF_maxHeight, RUF_Quality, true, pau_saveWidth, pau_saveHeight, RUF_AspectImages, pau_nameConflict, ""

if (RUF_MakeThumb)
ResizeUploadedFiles(RUF_Component, RUF_DotNetResize, pau_thePath, RUF_Suffix, RUF_maxWidthThumb, RUF_maxHeightThumb, RUF_QualityThumb, false, pau_saveWidth, pau_saveHeight, RUF_AspectThumb, pau_nameConflict, ""

if (String(RUF_RedirectURL) != ""

Response.Redirect(RUF_RedirectURL);
}
%>
<%
// *** Edit Operations: (Modified for File Upload) declare variables
// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME"

if (UploadQueryString) {
MM_editAction += "?" + UploadQueryString;
}
// boolean to abort record edit
var MM_abortEdit = false;
// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: (Modified for File Upload) set variables
if (String(UploadFormRequest("MM_insert"


var MM_editConnection = MM_mswdb_STRING;
var MM_editTable = "dbo.selldata";
var MM_editRedirectUrl = "thankyou.htm";
var MM_fieldsStr = "FirstName|value|Surname|value|Town|value|Post1|value|post2|value|Tel1|value|Tel2|value|Email|value|lsMake|value|Model|value|Spec|value|lsCategory|value|lsFuelType|value|lsYear|value|Price|value|AddInfo|value|file|value";
var MM_columnsStr = "FirstName|',none,''|SurName|',none,''|Town|',none,''|Post1|',none,''|Post2|',none,''|Tel1|',none,''|Tel2|',none,''|Email|',none,''|Make|',none,''|Model|',none,''|Spec|',none,''|Category|',none,''|FuelType|',none,''|age|none,none,NULL|Price|',none,''|AdditionalInfo|',none,''|photo|',none,''";
// create the MM_fields and MM_columns arrays
var MM_fields = MM_fieldsStr.split("|"

var MM_columns = MM_columnsStr.split("|"

// set the form values
for (var i=0; i+1 < MM_fields.length; i+=2) {
MM_fields[i+1] = String(UploadFormRequest(MM_fields[i]));
}
// append the query string to the redirect URL
if (MM_editRedirectUrl && UploadQueryString && UploadQueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&"

}
}
%>
<%
// *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it
if (String(UploadFormRequest("MM_insert"


// create the sql insert statement
var MM_tableValues = "", MM_dbValues = "";
for (var i=0; i+1 < MM_fields.length; i+=2) {
var formVal = MM_fields[i+1];
var MM_typesArray = MM_columns[i+1].split(","

var delim = (MM_typesArray[0] != "none"

var altVal = (MM_typesArray[1] != "none"

var emptyVal = (MM_typesArray[2] != "none"

if (formVal == "" || formVal == "undefined"

formVal = emptyVal;
} else {
if (altVal != ""

formVal = altVal;
} else if (delim == "'"

formVal = "'" + formVal.replace(/'/g,"''"

} else {
formVal = delim + formVal + delim;
}
}
MM_tableValues += ((i != 0) ? "," : ""

MM_dbValues += ((i != 0) ? "," : ""

}
MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + "


if (!MM_abortEdit) {
// execute the insert
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
<img src=../images/dmxzone/forum/icon_smile_question.gif border=0 align=middle>
if (MM_editRedirectUrl)
{
Response.Redirect(MM_editRedirectUrl);
}
}
}
%>
<%
var rsMake = Server.CreateObject("ADODB.Recordset"

rsMake.ActiveConnection = MM_mswdb_STRING;
rsMake.Source = "SELECT * FROM dbo.Make ORDER BY Make ASC";
rsMake.CursorType = 0;
rsMake.CursorLocation = 2;
rsMake.LockType = 1;
rsMake.Open();
var rsMake_numRows = 0;
%>
<%
var rsCategory = Server.CreateObject("ADODB.Recordset"

rsCategory.ActiveConnection = MM_mswdb_STRING;
rsCategory.Source = "SELECT * FROM dbo.Category ORDER BY category ASC";
rsCategory.CursorType = 0;
rsCategory.CursorLocation = 2;
rsCategory.LockType = 1;
rsCategory.Open();
var rsCategory_numRows = 0;
%>
<%
var rsFuelType = Server.CreateObject("ADODB.Recordset"

rsFuelType.ActiveConnection = MM_mswdb_STRING;
rsFuelType.Source = "SELECT * FROM dbo.FuelType ORDER BY FuelType ASC";
rsFuelType.CursorType = 0;
rsFuelType.CursorLocation = 2;
rsFuelType.LockType = 1;
rsFuelType.Open();
var rsFuelType_numRows = 0;
%>
<%
var rsYear = Server.CreateObject("ADODB.Recordset"

rsYear.ActiveConnection = MM_mswdb_STRING;
rsYear.Source = "SELECT * FROM dbo.Dates ORDER BY dates DESC";
rsYear.CursorType = 0;
rsYear.CursorLocation = 2;
rsYear.LockType = 1;
rsYear.Open();
var rsYear_numRows = 0;
%>
<html><!-- InstanceBegin template="file:///C|/Inetpub/wwwroot/MSW/Templates/Primary.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Sell a Car</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
for (i=1; i<a.length;i=i+4){
if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
o=MM_findObj(a[i].replace(/\[\d+\]/ig,""

o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""

v=o.value;t=a[i+2];
if (o.type=='text'||o.type=='password'||o.type=='hidden'){
if (r&&v.length==0){err=true}
if (v.length>0)
if (t==1){ //fromto
ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
} else if (t==2){
rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$"

} else if (t==3){ // date
ma=a[i+1].split("#"

if(at){
cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
dte=new Date(cy,cm,cd);
if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
}else{err=true}
} else if (t==4){ // time
ma=a[i+1].split("#"

} else if (t==5){ // check this 2
if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,""

if(!o1.checked){err=true}
} else if (t==6){ // the same
if(v!=MM_findObj(a[i+1]).value){err=true}
}
} else
if (!o.type&&o.length>0&&o[0].type=='radio'){
at = a[i].match(/(.*)\[(\d+)\].*/i);
o2=(o.length>1)?o[at[2]]<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>;
if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
if (t==2){
oo=false;
for(j=0;j<o.length;j++){oo=oo||o[j].checked}
if(!oo){s+='* '+a[i+3]+'\n'}
}
} else if (o.type=='checkbox'){
if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
} else if (o.type=='select-one'||o.type=='select-multiple'){
if(t==1&&o.selectedIndex/1==0){err=true}
}else if (o.type=='textarea'){
if(v.length<a[i+1]){err=true}
}
if (err){s+='* '+a[i+3]+'\n'; err=false}
}
if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
document.MM_returnValue = (s=='');
}
//-->
</script>
<!-- InstanceEndEditable -->
</head>
<body>
<table width="790" border="0" align="left" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1"> </td>
<td width="162"> </td>
<td width="29"><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><img src="../images/Logo.gif" width="570" height="101" align="right" /></td>
</tr>
<tr>
<td height="28"> </td>
<td width="162"> </td>
<td colspan="2" align="center" valign="middle" class="NaviBar"><a href="../Index.asp">Home</a>
| <a href="../buy/index.asp">Buy</a> | <a href="index.asp">Sell</a>
| <a href="../Privacy/index.html">Privacy</a> | <a href="../Contactus/Index.html">Contact
Us</a></td>
<td width="130"> </td>
</tr>
<tr>
<td rowspan="4"></td>
<td width="162" rowspan="3" align="left" valign="top" bgcolor="#808040"><!-- InstanceBeginEditable name="SidBarPicture" -->
<script language="javascript" src="../ScriptLibrary/incPureUpload.js"></script>
<img src="../images/Carsidebanner.gif" width="162" height="506"><!-- InstanceEndEditable --></td>
<td width="29" height="66" bgcolor="#999900"> </td>
<td width="458" valign="bottom" bgcolor="#999900"><strong><font color="#000000" size="7"><!-- InstanceBeginEditable name="Title" -->Sell
a Car<!-- InstanceEndEditable --></font></strong></td>
<td width="130" bgcolor="#808040"> </td>
</tr>
<tr>
<td width="29" height="75" bgcolor="#999900"> </td>
<td width="458" height="75" valign="top" bgcolor="#999900"><!-- InstanceBeginEditable name="Description" -->Required
Information <font color="#FF0000">*</font><!-- InstanceEndEditable --></td>
<td width="130" bgcolor="#808040"> </td>
</tr>
<tr>
<td width="29" height="378" bgcolor="#999900"> </td>
<!-- InstanceBeginEditable name="MainBody" -->
<td width="458" rowspan="2" valign="top" bgcolor="#999900"><form action="<%=MM_editAction%>" method="post" enctype="multipart/form-data" name="form1" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG',false,300,'','','','','','');YY_checkform('form1','FirstName','#q','0','Please enter your First Name','Surname','#q','0','Please enter you Surname','Town','#q','0','Please enter your town','Post1','#q','0','Please enter at least the first part of you Post Code','Tel1','#q','0','Please enter a contact Telephone Number','Email','#S','2','Please enter a valid E-mail Address','Price','#1_1000000','1','Please enter a Price between 1 and 1,000,000','lsMake','#q','1','Please select a Make');return document.MM_returnValue">
<table width="375" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td class="bodytext" width="4"> </td>
<td class="bodytext" width="211"> First Name<font color="#FF0000">*</font></td>
<td width="120"> <input type="text" name="FirstName" tabindex=1 size="20">
</td>
<td colspan="4" rowspan="15"> </td>
</tr>
<tr>
<td class="bodytext" width="4"> </td>
<td class="bodytext" width="211">Surname<font color="#FF0000">*</font>
</td>
<td> <input type="text" name="Surname" tabindex=2 size="20"> </td>
</tr>
<tr>
<td class="bodytext" width="4"> </td>
<td class="bodytext" width="211">Town<font color="#FF0000">*</font></td>
<td> <input type="text" name="Town" tabindex=3 size="20"> </td>
</tr>
<tr>
<td class="bodytext" width="4" height="22"> </td>
<td class="bodytext" width="211" height="22">PostCode<font color="#FF0000">*</font></td>
<td height="22"> <input type="text" name="Post1" tabindex=4 size="4" maxlength="4">
<input type="text" name="post2" tabindex=5 size="3" maxlength="3">
</td>
</tr>
<tr>
<td class="bodytext" width="4"> </td>
<td class="bodytext" width="211">Tel 1<font color="#FF0000">*</font></td>
<td> <input type="text" name="Tel1" tabindex=6 size="20"> </td>
</tr>
<tr>
<td class="bodytext" width="4"> </td>
<td class="bodytext" width="211">Tel 2 </td>
<td> <input type="text" name="Tel2" tabindex=7 size="20"> </td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">E-Mail<font color="#FF0000">*</font></td>
<td><input type="text" name="Email" tabindex=8 size="20"></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext"> </td>
<td> </td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">Make<font color="#FF0000">*</font></td>
<td><select name="lsMake" tabindex=9 id="lsMake">
<option value="%">Choose.......................</option>
<%
while (!rsMake.EOF) {
%>
<option value="<%=(rsMake.Fields.Item("Make"


<%
rsMake.MoveNext();
}
if (rsMake.CursorType > 0) {
if (!rsMake.BOF) rsMake.MoveFirst();
} else {
rsMake.Requery();
}
%>
</select></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">Model</td>
<td><input type="text" name="Model" tabindex=10 size="20"></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">Specification (e.g. GTI)</td>
<td><input type="text" name="Spec" tabindex=11 size="20"></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">Category<font color="#FF0000">*</font></td>
<td><select name="lsCategory" tabindex=12 id="lsCategory">
<option value="%">Choose.......................</option>
<%
while (!rsCategory.EOF) {
%>
<option value="<%=(rsCategory.Fields.Item("category"


<%
rsCategory.MoveNext();
}
if (rsCategory.CursorType > 0) {
if (!rsCategory.BOF) rsCategory.MoveFirst();
} else {
rsCategory.Requery();
}
%>
</select></td>
</tr>
<tr>
<td height="26" class="bodytext"> </td>
<td class="bodytext">Fuel type<font color="#FF0000">*</font></td>
<td><select name="lsFuelType" tabindex=13 id="lsFuelType">
<option value="%">Choose.......................</option>
<%
while (!rsFuelType.EOF) {
%>
<option value="<%=(rsFuelType.Fields.Item("FuelType"


<%
rsFuelType.MoveNext();
}
if (rsFuelType.CursorType > 0) {
if (!rsFuelType.BOF) rsFuelType.MoveFirst();
} else {
rsFuelType.Requery();
}
%>
</select></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td class="bodytext">Year<font color="#FF0000">*</font></td>
<td><select name="lsYear" tabindex=14 id="lsYear">
<option value="%">Choose.......................</option>
<%
while (!rsYear.EOF) {
%>
<option value="<%=(rsYear.Fields.Item("dates"


<%
rsYear.MoveNext();
}
if (rsYear.CursorType > 0) {
if (!rsYear.BOF) rsYear.MoveFirst();
} else {
rsYear.Requery();
}
%>
</select></td>
</tr>
<tr>
<td width="4" height="24" class="bodytext"> </td>
<td class="bodytext" width="211">Price<font color="#FF0000">* </font>(numbers
only) £</td>
<td> <p>
<input type="text" name="Price" tabindex=15 size="20">
</p>
</td>
</tr>
<tr>
<td width="4" height="212" rowspan="3" valign="top" class="bodytext">
<div align="left">
<p > </p>
<p > </p>
<p> </p>
</div></td>
<td colspan="6" class="bodytext" valign="top"> <p><br>
Additional Information<br>
(e.g. Colour, History, Mileage Etc) Max 255 Characters
<textarea name="AddInfo" tabindex=16 cols="50" rows="2"></textarea>
</p>
</td>
</tr>
<tr>
<td class="bodytext" valign="top"><p>Insert a photo here<br>
(300KB Max)
<input name="file" type="file" tabindex=17 value="" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG',false,300,'','','','','','')" size="20">
</p>
</td>
<td class="bodytext" valign="top"><div align="right">
<input type="submit" name="Submit" tabindex=18 value="Submit">
</div></td>
<td width="12" valign="top" class="bodytext"> </td>
<td width="2" valign="top" class="bodytext"> </td>
<td width="2" valign="top" class="bodytext"> </td>
<td width="2" valign="top" class="bodytext"> </td>
</tr>
<tr>
<td colspan="6" class="bodytext" valign="top"> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form></td>
<!-- InstanceEndEditable -->
<td width="130" bgcolor="#808040"> </td>
</tr>
<tr>
<td width="162" height="23" bgcolor="#808040"> </td>
<td width="29" valign="top" bgcolor="#999900">
<div align="center"></div></td>
<td width="130" bgcolor="#808040"> </td>
</tr>
<tr>
<td height="38" rowspan="2"></td>
<td width="162" bgcolor="#FFFFFF"> </td>
<td colspan="2" bgcolor="#FFFFFF"><div align="center"><a href="../Index.asp">Home</a>
| <a href="../buy/index.asp">Buy</a> | <a href="index.asp">Sell</a>
| <a href="../Privacy/index.html">Privacy</a> | <a href="../Contactus/Index.html">Contact
Us</a></div></td>
<td width="130"> </td>
</tr>
<tr>
<td width="162" bgcolor="#808040"> </td>
<td width="29" bgcolor="#999900"> </td>
<td width="458" bgcolor="#999900"> </td>
<td width="130" bgcolor="#808040"> </td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<%
rsMake.Close();
%>
<%
rsCategory.Close();
%>
<%
rsFuelType.Close();
%>
<%
rsYear.Close();
%>
<img src=../images/dmxzone/forum/icon_smile_question.gif border=0 align=middle>