I have some code that allows me to take all the Request.Form data from any form and send it in an email with just these two lines of code:
FOR EACH el IN Request.Form
msg.appendtext( el & ": " & Request.form(el) & vbcrlf )
Is is possible to do the same thing when entering form data into a database. All the filed names are the same as the form field names. This is the code I am using.
FOR EACH el IN Request.Form
msg.appendtext( el & ": " & Request.form(el) & vbcrlf )
Is is possible to do the same thing when entering form data into a database. All the filed names are the same as the form field names. This is the code I am using.
Code:
FOR EACH el IN Request.Form msg.appendtext( el & ": " & Request.form(el) & vbcrlf ) objRs.AddNew objrs(el) = request.form(el) objRs.Update objRs.Close Set objRs = Nothing objConn.Close Set objConn = Nothing NEXT If not msg.Send("mail.domain.com" ) then Response.write "<pre>" & msg.log & "</pre>" Else Response.write "Message sent succesfully!" End if
Comment