Results 1 to 1 of 1
Dec 6, 2004, 18:38 #1
script sends formdata - need to write to file too
Hi Folks -
My web form calls to cgi-bin/mail.asp and does a great job of sending my form data message text everywhere I want it to go via email.
Problem is, I also want to write (append) just the form field data to a CSV text file. I don't want or need the field names from the form or the other text that gets sent out via email.
Can a FORM have more than one "action/method" call in it?
Can I accomplish this from within my existing script?
Or do I have to have the first script call a second script that parses the form data, adds, commas, opens, appends and closes the file?
The short and simple script that I use now that sends out the email and redirects to a thankyou page is below.
Thanks in advance for any help and/or suggestions you might have,
<% name = Request.Form ("name") last_name = Request.Form ("last_name") city = Request.Form ("city") state = Request.Form ("state") from = Request.Form ("from") comments = Request.Form ("comments") message = message & "---- Feedback Form ----" & VBCrLF & VBCrLF message = message & name & " " & last_name & VBCrLf message = message & city & ", " & state & VBCrLf & VBCrLf message = message & "Email: " & from & VBCrLf & VBCrLf message = message & "Feedback: " & VBCrLf message = message & comments & VBCrLf & VBCrLf set smtp = Server.CreateObject("Bamboo.SMTP") ' You only need to change the smtp.Rcpt ans smpt.from part to your email address smtp.Server = "mail.example.com" smtp.Rcpt = "firstname.lastname@example.org" smtp.From = from smtp.FromName = name smtp.Subject = "replace with subject" smtp.Message = message on error resume next smtp.Send if err then response.Write err.Description else response.Redirect "thankyou.htm" end if set smtp = Nothing %>
Last edited by michael - ohio; Dec 8, 2004 at 22:40.