Advertisement
pepoflex

contactusprocess.asp

Aug 24th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.92 KB | None | 0 0
  1. <%
  2. mail_to = "jrclurita@gmail.com"
  3.  
  4. Dim error
  5. error = 0
  6. For Each f In Request.Form
  7.   If Request.Form(f) = "" Then
  8.     error = 1
  9.   End If
  10. Next
  11. If error=1 Then
  12.   response.redirect "error.html"
  13. Else
  14. Dim f, emsg, mail_to, r, o, c, other
  15. fline = "_______________________________________________________________________"& vbNewLine  
  16. hline = vbNewLine & "_____________________________________"& vbNewLine  
  17. emsg = ""
  18.  
  19. For Each f In Request.Form
  20.    If mid(f,1,1)<>"S"  = True Then 'do not save if input name starts with S
  21.      emsg  = emsg & f & " = " &  Trim(Request.Form(f)) & hline
  22.    End If
  23. Next
  24.  
  25. Set objNewMail = Server.CreateObject("CDONTS.NewMail")
  26.     objNewMail.From = Request("Email Address")
  27.     objNewMail.Subject = "Message from contact page (version: 1.0)"
  28.     objNewMail.To = mail_to
  29.     objNewMail.Body = emsg & fline
  30.     objNewMail.Send
  31.     Set objNewMail = Nothing
  32.  
  33. response.redirect "thankyou.html"
  34. End if
  35. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement