<%@ Language=VBScript EnableSessionState=False%><%Response.Buffer = true%>Join Smarthome Discount Club<%Public Function WriteToFile(ByVal strFile, ByVal strContents, ByVal blnAppend)'---------------------------------------------------------' Write to a log or error file and append or overwrite.'--------------------------------------------------------- Dim objFSO Dim objNewFile Const ForAppending = 8 On Error Resume Next Set objFSO= CreateObject('Scripting.FileSystemObject') If blnAppend Then If objFSO.FileExists(strFile) Then Set objNewFile = objFSO.OpenTextFile(strFile, ForAppending) Else Set objNewFile = objFSO.CreateTextFile(strFile) End If Else Set objNewFile = objFSO.CreateTextFile(strFile) End If If IsObject(objNewFile) Then objNewFile.WriteLine(strContents) objNewFile.close End if Set objNewFile = Nothing Set objFSO = Nothing End FunctionPublic Sub UpdateTextFile(ByVal strFileName, byval strContents)'----------------------------------------------------''---------------------------------------------------- Dim objFSO, objFile ' Dim strFileName ' dim strContents dim i on error resume next ' strFileName = Trim(strPath & strFileName) & '.txt' 'Wait until this file freed Do While Application(strFileName) = 'Locked' and i<1000 i=i+1 Loop 'Lock Application(strFileName) = 'Locked' Set objFSO = CreateObject('Scripting.FileSystemObject') Set objFile = objFSO.OpenTextFile(strFileName, 8, True) ' -- in above code, ' -- 1 = for reading ' -- 0 = TriStateFalse '8=append If IsObject(objFile) Then 'strContents=cStr(Month(Now)) & '/' & CStr(Day(Now)) & '/' & CStr(Year(Now)) & ',' & cstr(hour(now)) & ':' & cstr(minute(now)) objFile.WriteLine(strContents) objFile.Close End if Set objFile = Nothing Set objFSO = Nothing 'Free Application(strFileKey) = '' End SubPublic Function FindAndReplaceAll(ByVal strSource, ByVal strFind, ByVal strReplace)'-------------------------------------------------------''------------------------------------------------------- Dim lngFoundAt Dim strResult Dim lngFrom Dim intCounter Dim intIndex intIndex = 0 strResult = strSource lngFrom = 1 Do lngFoundAt = InStr(lngFrom, UCase(strResult), UCase(strFind)) If lngFoundAt <> 0 Then intCounter = intCounter + 1 If intIndex = 0 Then strResult = Left(strResult, lngFoundAt - 1) & strReplace & Right(strResult, (Len(strResult) - (lngFoundAt + Len(strFind) - 1))) Else If intCounter > intIndex Then Exit Do ElseIf intCounter = intIndex Then strResult = Left(strResult, lngFoundAt - 1) & strReplace & Right(strResult, (Len(strResult) - (lngFoundAt + Len(strFind) - 1))) End If End If lngFrom = lngFoundAt + Len(strReplace) End If Loop Until lngFoundAt = 0 FindAndReplaceAll = strResultEnd FunctionPublic Function AddToList(ByVal mailserver, ByVal userEmail, ByVal joinlist, ByVal mailFormat, ByVal override) if instr(1, userEmail, '@') = 0 or userEmail = '' or len(mid(userEmail, instr(1, userEmail, '@') + 1, 3)) = 0 then ' If there's no '@', stop here... AddToList = false Exit Function else ' continue if UCase(override) = 'ON' then ' User wants to override email validation, and at least it passed the above test, so... if UCase(mailFormat) = 'HTML' then Call SendAspEmail(mailserver, [email protected]', [email protected]', 'Leave Home Automation Systems List', 'QLEAVE ' & joinlist & ' ' & userEmail) Call SendASPEmail(mailserver, [email protected]', [email protected]', 'Join Home Automation Systems List', 'JOIN HASEmailList2 ' & userEmail) else Call SendAspEmail(mailserver, [email protected]', [email protected]', 'Leave Home Automation Systems List', 'QLEAVE HASEmailList2 ' & userEmail) Call SendASPEmail(mailserver, [email protected]', [email protected]', 'Join Home Automation Systems List', 'JOIN ' & joinlist & ' ' & userEmail) end if AddToList = true Exit Function end if if UCase(mailFormat) = 'HTML' then Call SendAspEmail(mailserver, [email protected]', [email protected]', 'Leave Home Automation Systems List', 'QLEAVE ' & joinlist & ' ' & userEmail) Call SendASPEmail(mailserver, [email protected]', [email protected]', 'Join Home Automation Systems List', 'JOIN HASEmailList2 ' & userEmail) else Call SendAspEmail(mailserver, [email protected]', [email protected]', 'Leave Home Automation Systems List', 'QLEAVE HASEmailList2 ' & userEmail) Call SendASPEmail(mailserver, [email protected]', [email protected]', 'Join Home Automation Systems List', 'JOIN ' & joinlist & ' ' & userEmail) end if AddToList = true end ifEnd FunctionPublic Sub SendASPEmail(ByVal mailserver, ByVal mailFrom, ByVal mailTo, ByVal mailSubject, ByVal mailBody) Dim objMail set objMail = server.CreateObject('Persits.MailSender') objMail.Host = mailserver objMail.Port = 25 objMail.From = mailFrom objMail.AddAddress mailTo objMail.Subject = mailSubject objMail.Body = mailBody On Error Resume Next objMail.Send If Err <> 0 Then 'Write the error to file and log everything. End If Set objMail = nothingEnd Sub%> <%' Begin DeclarationsDim boolEmailDim ls_emailDim ls_listDim ls_formatDim ls_override' End Declarations ls_email = trim(Request.Form('address')) ls_list = trim(Request.Form('listname')) ls_format = Request.Form('format') ls_override = Request.Form('override')boolEmail = trueif trim(Request.Form('action')) = 'join' and trim(Request.form('address')) <> '' then boolEmail = AddToList('mail1.list.smarthome.com', ls_email, ls_list, ls_format, ls_override)end ifif boolEmail = true and Request.Form('action') = 'join' and trim(Request.form('address')) <> '' then 'take to thank you page Response.Redirect('thankinfobeta.html')else%>
  • Don't miss any of our sales!
  • Be the first to find out about the latest new products!

Automatically receive information by e-mail on sale specials and new product additions. E-mails will be sent out approximately 1-4 times a month.

Please enter your e-mail address and press the "Join" button.

<%if boolEmail = false then%><%end if%>
E-mail Address:
<%if ucase(ls_format) = 'TEXT' then%> HTML Text<%else%> HTML Text<%end if%>
It appears an invalid Email address was entered. Please verify and try again.
Check here if you are sure the email address you entered is correct, and press the "JOIN" button again.

Foreign E-mail list This list is for foreign customers.



<% end if %>
place your order by 3pm PT for same day shipping

Please wait...