%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% dim name : name = cleanString(request.form("name")) dim housenumber : housenumber = cleanString(request.form("housenumber")) dim address1 : address1 = cleanString(request.form("address1")) dim address2 : address2 = cleanString(request.form("address2")) dim postcode : postcode = cleanString(request.form("postcode")) dim telephone : telephone = cleanString(request.form("telephone")) dim email : email = cleanString(request.form("email")) dim source : source = cleanString(request.form("source")) dim sentence : sentence = cleanString(request.form("sentence")) dim strErrors : strErrors = "" if request.form("postback")="yes" then 'validate the form! if len(name) < 1 then strErrors = strErrors & "name," if len(housenumber) < 1 then strErrors = strErrors & "housenumber," if len(address1) < 1 then strErrors = strErrors & "address1," if len(address2) < 1 then strErrors = strErrors & "address2," if len(postcode) < 1 then strErrors = strErrors & "postcode," if len(telephone) < 1 then strErrors = strErrors & "telephone," if len(email) < 1 then strErrors = strErrors & "email," if len(strErrors) < 1 then Dim sEmailTo, sRecipient, sSender, sEmailBody, blnSuccess Dim cdoMessage, cdoConfig sEmailBody = "Competition entry for Torak" & vbCrLf & vbCrLf &_ "Name : " & name & vbCRLF & _ "House Number : " & housenumber & vbCRLF & _ "Address 1 : " & address1 & vbCRLF & _ "Address 2 : " & address2 & vbCRLF & _ "Post Code : " & postcode & vbCRLF & _ "Telephone : " & telephone & vbCRLF & _ "Email : " & email & vbCRLF & _ "Source : " & source & vbCRLF & _ "25 words..." & sentence & vbCRLF Set cdoMessage = Server.CreateObject("CDO.Message") Set cdoConfig = Server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-relay.bne.server-mail.com" cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'If username/passowrd required you need to edit the next two lines. Remove the "'" at the beginning of the line 'cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "USERNAME GOES HERE" 'cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD GOES HERE" cdoConfig.Fields.Update Set cdoMessage.Configuration = cdoConfig cdoMessage.To = "childrens.books@hachette.com.au" cdoMessage.From = "childrens.books@hachette.com.au" cdoMessage.BCC = "colinabrennan@gmail.com" cdoMessage.Subject = "Torak - Competition Entry" cdoMessage.TextBody = sEmailBody cdoMessage.Send() If Err.number <> 0 Then Response.write Err.Number Else 'did they want to signup to the mailing list? if newsletter = "yes" then Dim cdoMessage2 : Set cdoMessage2 = Server.CreateObject("CDO.Message") Set cdoMessage2.Configuration = cdoConfig cdoMessage2.To = "childrens.books@hachette.com.au" cdoMessage2.From = "childrens.books@hachette.com.au" cdoMessage2.BCC = "childrens.books@hachette.com.au" cdoMessage2.Subject = "Beast Quest Newsletter Registration" cdoMessage2.TextBody = email cdoMessage2.Send() Set cdoMessage2 = Nothing end if Response.Redirect "/torak/thankyou.html" End If Set cdoMessage = Nothing Set cdoConfig = Nothing end if end if function cleanString(instring) instring = replace(instring,"to:", "") instring = replace(instring,"bcc", "") instring = replace(instring,"Content-", "") cleanString = instring end function %>
![]() |
![]() |
![]() |
![]() |
|
|
![]() |
![]() |
||||
|
|
|||||