Hello all!
I'm trying to adjust this ASP (in VBScript) to send information to my email that a user has filled out. Now there are multiple checkboxes on the form the user is filling out, someone told me to use a loop-type of statement to do this, but I'm not quite sure how. Can someone give me a quick example? Here's the VBScript so far:
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.FromName = Request.Form("Name"
Mailer.FromAddress = Request.Form("Email"
Mailer.RemoteHost = "website.com"
Mailer.AddRecipient "Info","dude@website.com"
Mailer.Subject = "Info Request From WebSite"
strMsgHeader = "The following information was collected:" & vbCrLf
for i = 1 to Request.Form.Count
strMsgInfo = strMsgInfo & Request.Form.Key(i) & "-"&Request.Form.Item(i) & vbCrLf
next
strMsgFooter = vbCrLf & "End of Form Information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail error"
end if
%>
Try using these bits of checkbox html if you can:
<input type="checkbox" name="checkbox1" value="checkbox">
<input type="checkbox" name="checkbox2" value="checkbox">
<input type="checkbox" name="checkbox3" value="checkbox">
Obviously I have more checkboxes than this, which is why I need to figure out the loop =)
Thanks,
Jisoo22
I'm trying to adjust this ASP (in VBScript) to send information to my email that a user has filled out. Now there are multiple checkboxes on the form the user is filling out, someone told me to use a loop-type of statement to do this, but I'm not quite sure how. Can someone give me a quick example? Here's the VBScript so far:
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.FromName = Request.Form("Name"
Mailer.FromAddress = Request.Form("Email"
Mailer.RemoteHost = "website.com"
Mailer.AddRecipient "Info","dude@website.com"
Mailer.Subject = "Info Request From WebSite"
strMsgHeader = "The following information was collected:" & vbCrLf
for i = 1 to Request.Form.Count
strMsgInfo = strMsgInfo & Request.Form.Key(i) & "-"&Request.Form.Item(i) & vbCrLf
next
strMsgFooter = vbCrLf & "End of Form Information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail error"
end if
%>
Try using these bits of checkbox html if you can:
<input type="checkbox" name="checkbox1" value="checkbox">
<input type="checkbox" name="checkbox2" value="checkbox">
<input type="checkbox" name="checkbox3" value="checkbox">
Obviously I have more checkboxes than this, which is why I need to figure out the loop =)
Thanks,
Jisoo22