Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick help on ASP Email sending

Status
Not open for further replies.

jisoo22

Programmer
Apr 30, 2001
277
US
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(&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = Request.Form(&quot;Name&quot;)
Mailer.FromAddress = Request.Form(&quot;Email&quot;)
Mailer.RemoteHost = &quot;website.com&quot;
Mailer.AddRecipient &quot;Info&quot;,&quot;dude@website.com&quot;
Mailer.Subject = &quot;Info Request From WebSite&quot;
strMsgHeader = &quot;The following information was collected:&quot; & vbCrLf
for i = 1 to Request.Form.Count
strMsgInfo = strMsgInfo & Request.Form.Key(i) & &quot;-&quot;&Request.Form.Item(i) & vbCrLf
next
strMsgFooter = vbCrLf & &quot;End of Form Information&quot;
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Write &quot;Mail sent...&quot;
else
Response.Write &quot;Mail error&quot;
end if
%>

Try using these bits of checkbox html if you can:
<input type=&quot;checkbox&quot; name=&quot;checkbox1&quot; value=&quot;checkbox&quot;>
<input type=&quot;checkbox&quot; name=&quot;checkbox2&quot; value=&quot;checkbox&quot;>
<input type=&quot;checkbox&quot; name=&quot;checkbox3&quot; value=&quot;checkbox&quot;>

Obviously I have more checkboxes than this, which is why I need to figure out the loop =)

Thanks,
Jisoo22
 
Whoops, made a boo-boo. Not only do I have multiple checkboxes but textfields and radio buttons =P This is harder then I thought. Would the looping thing have anything to do with the (what looks like) dictionary object? I think it's a dictionary because of the &quot;.key()&quot; property.

Thanks,
Jisoo22
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top