Hi
I am not a web developer and am having trouble with the following asp script. I need to resolve this to move away from php.
Win2k3 with iis6
the code is as follows
contact.asp
<html>
<head>
<title>mail</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" link="#000066">
<form method="post" action="contact2.asp" name="">
<div align="center">
<table border="0" align="center" width="357" height="336">
<tr valign="middle">
<td height="27"> <div align="right">
<p><br>
<b><%=request.querystring("reqd")%> <a name="form"></a>Coct
Form </b></p>
</div></td>
</tr>
<tr>
<td height="297" valign="top">
<div align="center">
<table width="100%" border="0">
<tr>
<td bgcolor="#FFFFFF"> <div align="right"><%=request.querystring("mname")%>You r
Name:</div></td>
<td width="207" bgcolor="#FFFFFF"> <div align="right">
<input type="text" name="name" size="20" value="<%=request.querystring("name")%>">
</div></td>
</tr>
<tr>
<td> <div align="right"><%=request.querystring("memail")%>Em ail
Address:</div></td>
<td width="207" bgcolor="#FFFFFF"> <div align="right">
<input type="text" name="email" size="20" value="<%=request.querystring("email")%>">
</div></td>
</tr>
<tr>
<td valign="top"> <div align="right"><br>
<%=request.querystring("mmessage")%>Message:</div></td>
<td width="207" bgcolor="#FFFFFF"> <div align="right">
<textarea name="message" cols="20" rows="5"><%=request.querystring("message")%></textarea>
</div></td>
</tr>
<tr>
<td height="2"> <div align="right"></div></td>
<td width="207" height="2" bgcolor="#FFFFFF"> <div align="right">Click
here to send your message </div></td>
</tr>
<tr>
<td> </td>
<td width="207"> <div align="right">
<input type="submit" name="Submit" style="font-size: 8pt; font-family:
Verdana; color: #FFFFFF; font-weight: bold; background-color: #08086C" value="Send">
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<p> </p>
<p> </p>
</div>
</form>
</body>
</html>
contact2.asp
<%
name = request.form("name")
email = request.form("email")
message = request.form("message")
If name="" or email="" or message="" Then
url = "contact.asp?reqd=* indicates required field&name=" & name & "&email=" & email & "&message=" & message
If name="" Then
url = url & "&mname=*"
End if
If email="" Then
url = url & "&memail=*"
End if
If message="" Then
url = url & "&mmessage=*"
End if
response.redirect url & "&foobar=foobar#form"
response.end
End if
Dim objCDONTS ' Email object
Dim strFromName ' From persons' real name
Dim strFromEmail, strToEmail ' Email addresses
Dim strSubject, strBody ' Message
Dim misccompo
strSubject = "Web Contact Us Request"
strFromName = Trim(Request.Form("name"))
strFromEmail = Trim(Request.Form("email"))
strToEmail = "
[email protected]"
strBody = Trim(Request.Form("message"))
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = "--------------------------------------" & vbcrlf & vbcrlf & strbody & vbcrlf & vbcrlf & vbcrlf & "--------------------------------------------------------------" & vbcrlf & "MESSAGE ENDS: End of message"
objCDONTS.Send
Set objCDONTS = Nothing
response.redirect "index_contact_us_thank_you.htm"
response.end
%>