| |
|
 |
Call: (800)281-7450
|
 |
|
|
<% If Request("Subject") <> "" Then
Private Function URLDecode(byVal encodedstring)
Dim strIn, strOut, intPos, strLeft
Dim strRight, intLoop
strIn = encodedstring : strOut = "" : intPos = Instr(strIn, "+")
Do While intPos
strLeft = "" : strRight = ""
If intPos > 1 then strLeft = Left(strIn, intPos - 1)
If intPos < len(strIn) then strRight = Mid(strIn, intPos + 1)
strIn = strLeft & " " & strRight
intPos = InStr(strIn, "+")
intLoop = intLoop + 1
Loop
intPos = InStr(strIn, "%")
Do while intPos
If intPos > 1 then strOut = strOut & Left(strIn, intPos - 1)
strOut = strOut & Chr(CInt("&H" & mid(strIn, intPos + 1, 2)))
If intPos > (len(strIn) - 3) then
strIn = ""
Else
strIn = Mid(strIn, intPos + 3)
End If
intPos = InStr(strIn, "%")
Loop
URLDecode = strOut & strIn
End Function
Dim strBody
Dim FormName
FormName = Request.Form("FormName")
strBody = FormName & " Form Results - Submitted on: " & Now() & chr(13) & chr(10) & chr(13) & chr(10)
Set objMail = CreateObject("CDONTS.NewMail")
'HTTP Header Data Pairs: name=Dave&Address=My Address
' create 2 arrays, one for name/value pairs, one for
' each element in pairs will be name=value and pairs now has number of elements
pairs = split(request.form, "&")
'walk the collection:
for each item in pairs
'values will contain 2 elements, 1 for name, 1 for
values = split(item, "=")
'0 and 1 will always work since every item you go through has 0 and 1
'response.write values(0) & ": " & URLDecode(values(1))
'For Each Item in Request.Form - Old Code
'strBody = strBody & Item & ":" & " " & Request.Form(Item) & chr(13) & chr(10)
'Check if Hidden Value FormName is split then skip it on the Form
if values(0)="FormName" then
Else
strBody = strBody & values(0) & ": " & URLDecode(values(1)) & chr(13) & chr(10)
End If
Next
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = Request("Email")
objMail.To = "tom.wasson@sesi.net,ralph.shuler@sesi.net,larry.watts@sesi.net,nicole.roach@sesi.net" '"rfuleihan@icconline.com"
objMail.Subject = Request("Subject")
objMail.Body = strBody
mailres=objMail.Send()
if NOT mailres then %>
Thank you for your Comments/Questions.
<% else %>
Form Submission Failure
please contact SESI Webmaster
<% end if
Set objMail = Nothing
Else %>
<% End If %>
|
|
|
 |
|
|
 |
 |
 |
|
|
|
|
|
|