<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
Function echo(strOut)
Response.write strOut
End Function
Function die()
Response.end
End Function
If Len(request.form("FName")) >0 Then
Function fnSendMail(recipients, sender, subject, body)
Dim SMTP, RecipientArray, X
Set SMTP = CreateObject("EasyMail.SMTP.6")
SMTP.LicenseKey = "MediaNews Group Interactive (Single Developer)/0010641910C61C00E020"
SMTP.MailServer = "smtp.mnginteractive.com"
SMTP.Subject = subject
SMTP.BodyText = body
SMTP.FromAddr = sender
SMTP.From = sender
SMTP.BodyFormat = 1
SMTP.AutoWrap = 0
recipients = replace(recipients, ",", "~")
RecipientArray = Split(recipients, "~")
For Each X in RecipientArray
if not left(X,1) = "@" then
SMTP.AddRecipient "", X, 1
end if
Next
SMTP.Send
End Function
'GET ALL THE FORM FIELDS AND MAKE VARIABLES FROM THEM
Dim blnMakeAllBlankValuesNULL, blnShowFormVariables, strFormFieldName
Dim strTemp, strFormNames
' you don’t have to write: strData = Request.Form("strData") anymore…
' making blanks = 'NULL' for the DB:
blnMakeAllBlankValuesNULL = True
' show the form values for debug:
blnShowFormVariables = True
' ok, bring in the form's data, the new way, directly into VBScript variables:
For Each strFormFieldName In Request.Form
strFormNames = "strTemp=Request.Form(" & chr(34) & strFormFieldName & chr(34) & ")"
Execute(strFormNames)
If blnMakeAllBlankValuesNULL = True Then
If strTemp = "" Then
strTemp = "NULL"
End If
End If
strFormNames = strFormFieldName & "=strTemp"
Execute(strFormNames)
If blnShowFormVariables = True Then
strMessage = strMessage & strFormFieldName & " = " & eval(strFormFieldName) & " " & vbcrlf
End If
Next
Call fnSendMail("circulation@newstimes.com", email, "New! News-Times Subscription", strMessage)
echo("
THANK YOU! Your information has been sent. You should receive a confirmation e-mail shortly.