Guest_imported
New member
- Jan 1, 1970
- 0
Hi Everyone,
If I had the follow (below) and I wanted it to read in all Input Boxes then mail it. How can this be done?
So if one was to add or modify Input boxes in the HTML Form the script is still able to cope and mail all input off.
***************************************************
<html>
<body>
<%
If Len(Request.Form("txtEmail") > 0 then
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From = "mike@mike.com (mike mike)"
objMail.Subject = "Email with an Attachment"
objMail.AttachFile Server.MapPath("/images/box.gif"
objMail.To = Request.Form("txtEmail"
objMail.Body = Request.Form("namefield"
objMail.Send
Response.write("<i>Mail was Sent</i><p>"
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<p><b>Enter your email address:</b><br>
<input type="text" name="txtEmail" value="<%=Request.Form("txtEmail"%>">
</p>
<p>Name: <input type="text" name="namefield" value="<%=Request.Form("namefield"%>"> <BR>
attachment: <input type="file" name="file1">
</p>
<p>
<input type="submit" value="Email with an Attachment!" id=submit1 name=submit1>
</form>
</body>
</html>
If I had the follow (below) and I wanted it to read in all Input Boxes then mail it. How can this be done?
So if one was to add or modify Input boxes in the HTML Form the script is still able to cope and mail all input off.
***************************************************
<html>
<body>
<%
If Len(Request.Form("txtEmail") > 0 then
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From = "mike@mike.com (mike mike)"
objMail.Subject = "Email with an Attachment"
objMail.AttachFile Server.MapPath("/images/box.gif"
objMail.To = Request.Form("txtEmail"
objMail.Body = Request.Form("namefield"
objMail.Send
Response.write("<i>Mail was Sent</i><p>"
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<p><b>Enter your email address:</b><br>
<input type="text" name="txtEmail" value="<%=Request.Form("txtEmail"%>">
</p>
<p>Name: <input type="text" name="namefield" value="<%=Request.Form("namefield"%>"> <BR>
attachment: <input type="file" name="file1">
</p>
<p>
<input type="submit" value="Email with an Attachment!" id=submit1 name=submit1>
</form>
</body>
</html>