mina_shariat
Member
حذف
آخرین ویرایش:
<html>
<head>
<title>Example ASP email contact form</title>
</head>
<body>
<form method="POST" action="contactusprocess.asp">
<table>
<tr>
<td>Your Name:</td>
<td><input name="Name" size="25" maxlength="50"></td>
</tr>
<tr>
<td>Your Email:</td>
<td><input name="Email Address" size="25" maxlength="50"></td>
</tr>
<tr>
<td>Your Telephone:</td>
<td><input name="Telephone No" size="25" maxlength="50"> </td>
</tr>
<tr>
<td valign="top">Your Message:</td>
<td><textarea cols="24" name="Message" rows="6"></textarea> </td>
</tr>
<tr>
<td colspan="2"><div align="center"><center><p><input type="submit" value="Submit"
name="Submit"> </p>
</center></div><div align="center"><center><p>This form and code is free at: <a
href="http://asp.thedemosite.co.uk/">http://asp.thedemosite.co.uk/</a> </td>
</tr>
</table>
</form>
</body>
</html>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Freeware from Seiretto.com
' available at http://asp.thedemosite.co.uk
'
' DON'T forget to change the mail_to email address below!!!
' and thats all you need to change.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim error
error = 0
For Each f In Request.Form
If Request.Form(f) = "" Then
error = 1
End If
Next
If error=1 Then
response.redirect "error.html"
Else
Dim f, emsg, mail_to, r, o, c, other
mail_to = "[email protected]"
fline = "_______________________________________________________________________"& vbNewLine
hline = vbNewLine & "_____________________________________"& vbNewLine
emsg = ""
For Each f In Request.Form
If mid(f,1,1)<>"S" = True Then 'do not save if input name starts with S
emsg = emsg & f & " = " & Trim(Request.Form(f)) & hline
End If
Next
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = Request("Email Address")
objNewMail.Subject = "Message from contact page (version: 1.0)"
objNewMail.To = mail_to
objNewMail.Body = emsg & fline
objNewMail.Send
Set objNewMail = Nothing
response.redirect "thankyou.html"
End if
%>
<html>
<head>
<title>ERROR</title>
</head>
<body>
<p align="center"><strong>ERROR</strong></p>
<p align="center">One or more of the fields are not completed.<br>
Please go back and complete all fields.<br>
Enter "na" if any field is not applicable.</p>
<p align="center"><a href="javascript:history.go(-1)"><< Please go back</a></p>
</body>
</html>
<html>
<head>
<title>Message sent - thank you.</title>
</head>
<body>
<p align="center"> </p>
<p align="center"><strong>Your message has been sent.</strong></p>
<p align="center"><strong>Thank you.</strong></p>
</body>
</html>