form info to file

Please support our HTML and CSS advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Reply

Join Date: Jul 2008
Posts: 12
Reputation: rcdeck is an unknown quantity at this point 
Solved Threads: 0
rcdeck rcdeck is offline Offline
Newbie Poster

form info to file

 
0
  #1
Sep 18th, 2009
Good Afternoon,

I'm sure it is possible and hopefully someone here can help me.

I am looking to be able to send data from a form I have to a file server. Right now, I have it emailing the data but I am hoping to fully automate it by having it to straight to the file server.

Is there a way to do this? Or FTP it to one of our UNIX servers?

Any help would be greatly apprecaited.

Thanks in advance


Here is what i have for my asp form:

HTML and CSS Syntax (Toggle Plain Text)
  1. <%
  2. ' Website Contact Form Generator
  3. ' http://www.tele-pro.co.uk/scripts/contact_form/
  4. ' This script is free to use as long as you
  5. ' retain the credit link
  6.  
  7. ' declare variables
  8. Dim EmailFrom
  9. Dim EmailTo
  10. Dim Subject
  11. Dim FirstName
  12. Dim LastName
  13. Dim ContactExt
  14. Dim Suggestions
  15.  
  16. ' get posted data into variables
  17. EmailFrom = "user@user.com"
  18. EmailTo = "user@user.com"
  19. Subject = "Suggestions"
  20. FirstName = Trim(Request.Form("FirstName"))
  21. LastName = Trim(Request.Form("LastName"))
  22. ContactExt = Trim(Request.Form("ContactExt"))
  23. Suggestions = Trim(Request.Form("Suggestions"))
  24.  
  25. ' validation
  26. Dim validationOK
  27. validationOK=true
  28. If (Trim(Suggestions)="") Then validationOK=false
  29. If (validationOK=false) Then Response.Redirect("error_suggestions.htm?" & EmailFrom)
  30.  
  31. ' prepare email body text
  32. Dim Body
  33. Body = Body & "FirstName: " & FirstName & VbCrLf
  34. Body = Body & "LastName: " & LastName & VbCrLf
  35. Body = Body & "ContactExt: " & ContactExt & VbCrLf
  36. Body = Body & "Suggestions: " & Suggestions & VbCrLf
  37.  
  38. ' OLD CDONTS send email
  39. 'Dim mail
  40. 'Set mail = Server.CreateObject("CDONTS.NewMail")
  41. 'mail.To = EmailTo
  42. 'mail.CC = EmailCC
  43. 'mail.From = EmailFrom
  44. 'mail.Subject = Subject
  45. 'mail.Body = Body
  46. 'mail.Send
  47. 'Set mail=nothing
  48.  
  49. 'NEW CDOsys
  50. Dim iMsg
  51. Dim iConf
  52. Dim Flds
  53. Dim strHTML
  54. Dim strSmartHost
  55.  
  56. Const cdoSendUsingPort = 2
  57. StrSmartHost = "hosthere.com"
  58.  
  59. set iMsg = CreateObject("CDO.Message")
  60. set iConf = CreateObject("CDO.Configuration")
  61.  
  62. Set Flds = iConf.Fields
  63.  
  64. ' set the CDOSYS configuration fields to use port 25 on the SMTP server
  65.  
  66. With Flds
  67. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
  68. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
  69. .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
  70. .Update
  71. End With
  72.  
  73. With iMsg
  74. Set .Configuration = iConf
  75. .To = EmailTo
  76. .From = EmailFrom
  77. .CC = EmailCC
  78. .Subject = Subject
  79. .TextBody = Body
  80. .Send
  81. End With
  82.  
  83. ' cleanup of variables
  84. Set iMsg = Nothing
  85. Set iConf = Nothing
  86. Set Flds = Nothing
  87.  
  88. ' redirect to success page
  89. Response.Redirect("Confirmation.htm?")
  90. 'Response.Redirect("ok.htm?" & EmailFrom)
  91. %>
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,160
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 96
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Re: form info to file

 
0
  #2
Sep 18th, 2009
Right now, I have it emailing the data but I am hoping to fully automate it by having it to straight to the file server. you want to automate what? data e-mail comes from what application? just try to elaborate further..i'm sure experts around here can help you..

Last edited by cguan_77; Sep 18th, 2009 at 6:21 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 578 | Replies: 1
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC