<% on error resume next 'Response.Write("Hello ") 'Response.Write(server.MapPath("/")) 'Response.End Set oFS = Server.CreateObject("Scripting.FileSystemObject") if trim(request("s")) <> "" then KEYWORD=StrToTitleCase(request("s")) if Session("SSKEYWORD")=KEYWORD then sendemail=0 else if trim(request("o")) = "t" then sendemail=0 else sendemail=1 end if end if Session("SSKEYWORD")=KEYWORD else if Session("SSKEYWORD")<>"" then KEYWORD=Session("SSKEYWORD") else KEYWORD="Sales Support" end if if trim(request("o")) = "t" then sendemail=0 else sendemail=1 end if end if if instr(1,LCase(KEYWORD),"keyword")>0 then KEYWORD=StrToTitleCase("Sales Support") Session("SSKEYWORD")=KEYWORD end if if trim(KEYWORD) ="" then KEYWORD=StrToTitleCase("Sales Support") end if sFilePathAndName= server.MapPath("/") & "\salessupport.html" If oFS.FileExists(sFilePathAndName) = True Then Set oTextStream = oFS.OpenTextFile(sFilePathAndName,1) sFileContents = oTextStream.ReadAll oTextStream.Close Set oTextStream = nothing End if Set oFS = nothing 'sFileContents=replace(sFileContents,"","") sFileContents=replace(sFileContents,"Sales Support",KEYWORD) 'sFileContents=replace(sFileContents,"Virtual Assistant",KEYWORD) Response.Write(sFileContents) if trim(KEYWORD) <> "" and sendemail=1 then sendemail=0 StrReff= TRIM(request.servervariables("HTTP_REFERER")) if StrReff="" then StrReff="Referer Not Set" end if strbody="" strbody= strbody & "Keyword: " & StrToTitleCase(request("s")) & " (from google adword, dynamic ad.)" & chr(13) & chr(10) & chr(10) strbody= strbody & "URL: http://www.LiveHelpIndia.com/salessupport.asp?s=" & request("s") & chr(13) & chr(10) & chr(10) strbody= strbody & "IP Address: " & Request.ServerVariables("REMOTE_ADDR") & " (" & ip2country & ")" & chr(13) & chr(10) & chr(10) strbody= strbody & "Time of Visit: " & Now & " (US Central)" & chr(13) & chr(10) & chr(10) strbody= strbody & "Page Referer: " & StrReff & chr(13) & chr(10) & chr(10) subject = "Sales Support Service Visit from Google Adword" on error resume next Set mailer=CreateObject("CDO.Message") mailer.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 mailer.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="127.0.0.1" 'this should be changed to the smtp server you have access to mailer.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 'or the port configured for smtp mailer.Configuration.Fields.Update 'E-Mail to Us mailer.from = "postmaster@livehelpindia.com" 'mailer.BCC = "webmaster@livehelpindia.com" mailer.To = "vishal@cisin.com" mailer.subject = subject mailer.TextBody = strbody mailer.send set mailer= nothing if err.number then Response.Clear Response.Write err.Description Response.End end if end if Function StrToTitleCase(Str2Covert) ArrString = split(Str2Covert," ") For I = 0 To UBound(ArrString) StrLen = len(ArrString(I)) If StrLen > 0 Then If i < UBound(ArrString) Then StrReturn = StrReturn & ucase(left(ArrString(I),1)) & lcase(mid(ArrString(I),2, StrLen - 1)) & " " else If instr(1,lcase(ArrString(I)),"service")=0 Then StrReturn = StrReturn & ucase(left(ArrString(I),1)) & lcase(mid(ArrString(I),2, StrLen - 1)) & " " end if end if End If Next StrToTitleCase = trim(StrReturn) End Function if err.number <> 0 then response.write err.Description response.end end if %>