<%@LANGUAGE="VBSCRIPT"%> <% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Spd E-Letter v4 ' © 2001, 2002 PensaWorks, inc. ' For help with this program, please visit http://www.pensaworks.com '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' server.scripttimeout = 5000 response.buffer = true on error resume next %> <% bolErrors = False sub TrapError(strError) bolErrors = True strErrorMessage = Err.description end sub sub ProcessErrors() if bolErrors then Response.Redirect "setup.asp?action=Error&D=" & Server.URLEncode(Err.Description) & "&N=" & Server.URLEncode(Err.Number) & "&S=" & Server.URLEncode(Err.Source) end if end sub function ProcessErrors2() Response.Redirect "setup.asp?action=Error&D=" & Server.URLEncode(Err.Description) & "&N=" & Server.URLEncode(Err.Number) & "&S=" & Server.URLEncode(Err.Source) end function Dim Action : Action = "Test" If (Request("Action") <> "") Then Action = Request("Action") Dim msg : msg = "" If (Request("msg") <> "") Then msg = Request("msg") Dim TestDB : TestDB = "Y" If (Request("TestDB") <> "") Then TestDB = Request("TestDB") If Action = "Test" Then set dbTestConn = Server.CreateObject("ADODB.Connection") dbTestConn.Open(mlConn) if Err.Number <> 0 then Response.Redirect "setup.asp?action=DBError&TestDB=N&D=" & Server.URLEncode(Err.Description) & "&N=" & Server.URLEncode(Err.Number) & "&S=" & Server.URLEncode(Err.Source) else dbTestConn.Execute("DROP TABLE ML_TestTemp") err.clear() if dbType = "sql" then ' create sql test table dbTestConn.Execute("CREATE TABLE ML_TestTemp (TestID Int Null)") else ' create access test table dbTestConn.Execute("CREATE TABLE ML_TestTemp (TestID Int Null)") end if set doTest = dbTestConn.Execute("SELECT * FROM ML_TestTemp") if Err.Number <> 0 then set doTest = nothing dbTestConn.Execute("DROP TABLE ML_TestTemp") response.redirect "setup.asp?action=Permissions" else set doTest = nothing dbTestConn.Execute("DROP TABLE ML_TestTemp") response.Redirect "setup.asp?action=Login" end if end if end if if Action = "Login2" then if Request("Password") <> strSecPass then Response.Redirect "setup.asp?action=Login&msg=1" else Session("LoggedIn") = "Y" Response.Redirect "setup.asp?action=Install" end if end if set dbConn = Server.CreateObject("ADODB.Connection") dbConn.Open(mlConn) %> Spd E-Letter Setup

Spd E-Letter Setup

<% If Action = "Permissions" Then %>

 

ERROR!

Could not create the test table. Please check the permissions on your database to ensure that it has read, write, delete & execute abilities.

You can usually do this from a control panel provided by your host, but you may have to contact them directly to do this. If you must contact your host, be sure to let them know the exact path to the database you wish to use, otherwise you might have delays.

Click here to try again

 



<% end if %> <% If Action = "DBError" Then %>

ERROR!

A database connection could not be established. Please check your config.asp file and then click here.


The following Error Data was received and may help in fixing the connection to your database.

Error Number:

<%=Request("N")%>

Error Source:
<%=Request("S")%>

Error Description:
<%=Request("D")%>

 

 

<% End If %> <% If Action = "Login" Then %> <% If (Session("LoggedIn") = "Y") Then Response.Redirect "setup.asp?action=Install" %>

Please Login
<% IF msg = "1" Then %> Invalid Password <% End if %> <% IF msg = "2" Then %> You haven't logged in yet or your session has expired. Please log in. <% End if %> <% IF msg = "3" Then %> It appears as though you haven't yet installed the Spd E-Letter. Please do so now. <% End if %>

Password

<% End If %> <% If Action = "Install" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %>
Database Type

DISABLED> <%If (strDBType = "access") Then%> Access 2000<% Else %>Access 2000<% End If %>
DISABLED> <%If (strDBType = "sql") Then%>SQL Server<% Else %>SQL Server<% End If %>

If this is incorrect, please
change it in your config.asp file.

 

Action

New Installation
Upgrade From v3.0
Upgrade From v3.1
---------------------------
Uninstall (All Versions)

WARNING!
The use of the Uninstall will delete ALL tables associated with the Spd E-Letter v2.0 & 3.0. The process will allow you to export all of your subscribers, but does not do this automatically. Be cautious with this feature and refer to the readme.html that comes in the zip file.

<% End If %> <% If Action = "Error" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %>

ERROR!

There has been an error while processing the action you requested. If you need to contact our support team, the following information may be of great help. Please save a copy for later reference and include it in any support requests. Click here to go back to the main page.


<% If Request("erm") = "" Then %>

Referring URL: <%=Request.ServerVariables("HTTP_REFERER")%>
Server Date/Time: <%=Now%>
Error Number: <%=request("N")%>
Error Source:
<%=request("S")%>
Error Description Received:
<%=Request("D")%>

 

<% ElseIf Request("erm") = "1" Then %> It seems as though you are attempting to upgrade when the Spd E-Letter v2.0 has not been installed. Please try a new installation. <% End if %>

If the above error message states "Table 'ML_TableName' already exists", please uninstall the program before trying to install it. You will have the ability to save/backup any data already existing in those tables.

<% End If %> <% If Action = "NewInstall" Then If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" if lcase(strDBType) = "sql" then Results = TableCreate_SQL() else Results = TableCreate_Access() end if Response.Redirect "setup.asp?action=Finished&type=Install" End If %> <% If Action = "Uninstall" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %> <% response.write ""%>

WARNING!

Continuing with this process will remove all tables created by the Spd E-Letter. Do you wish to continue?

Be sure to save a backup of your subscribers table.

Yes   |   No

<% End If %>

<% If Action = "Uninstall2" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %> <% dbConn.Execute("DROP TABLE ML_Broadcast") dbConn.Execute("DROP TABLE ML_Lists") dbConn.Execute("DROP TABLE ML_Prefs") dbConn.Execute("DROP TABLE ML_Subscribers") dbConn.Execute("DROP TABLE ML_Users") dbConn.Execute("DROP TABLE ML_URLs") dbConn.Execute("DROP TABLE ML_Pending") dbConn.Execute("DROP TABLE ML_Clicks") dbConn.Execute("DROP TABLE ML_Reads") dbConn.Execute("DROP TABLE ML_Blocked") dbConn.Execute("DROP TABLE ML_Emails") dbConn.Execute("DROP TABLE ML_Snippets") dbConn.Execute("DROP TABLE ML_Temp") dbConn.Execute("DROP TABLE ML_Modules") Response.Redirect "setup.asp?action=Finished&type=Uninstall" %> <% End If %> <% If Action = "Upgrade20" Then %> <% If (Session("LoggedIn") <> "Y") Then response.redirect "setup.asp?action=Login&msg=2" %> <% ' Upgrade from version 2.0 Results = Upgrade20() response.write "" %> <% End If %> <% if Action = "Upgrade30" then %> <% If (Session("LoggedIn") <> "Y") Then response.redirect "setup.asp?action=Login&msg=2" %> <% ' Upgrade from version 3.0 Results = Upgrade30() Results = Upgrade31() 'response.end response.write "" End If %> <% if Action = "Upgrade31" then %> <% if (Session("LoggedIn") <> "Y") then response.redirect "setup.asp?action=Login&msg=2" %> <% ' Upgrade from version 3.1 Results = Upgrade31() response.write "" End If %>

<% If Action = "Finished" Then %> <% Response.Write "" %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %>

Finished!

<% If Request("type") = "Install" Then %>

The Spd E-Letter has been successfully installed. You will need to login to the administration section here and set your default settings. The initial username and password are as follows:
Username: admin
Password: admin5

<% ElseIf Request("type") = "Uninstall" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %>

The Spd E-Letter Tables have been successfully removed from your database. If you wish to install them again, please go here.

<% ElseIf Request("type") = "Upgrade" Then %> <% If (Session("LoggedIn") <> "Y") Then Response.Redirect "setup.asp?action=Login&msg=2" %>

The Upgrade to Spd E-Letter version 4.0 has been completed sucessfully. You may now proceed to login here.

Important: Please remember to change your site preferences as well as generate new HTML for your subscription forms.

<% End If %>

 

<% End If %> <% If Action = "Install20" Then %> Version 2.0 tables installed. Back to the Main Page. <% ' Upgrade from version 2.0 Results = Create_20() strSQL = "INSERT INTO ML_Broadcast (ToListID, FromEmail, FromName, Subject, TextMessage, HTMLMessage, TimeAdded, TimeSent, ReplyTo)" strSQL = strSQL & " VALUES ('1','myemail1@domain.com','my name1','Subject1','Text1','HTML1','9/8/2001 5:09:18 PM','9/8/2001 5:09:18 PM','James1')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Broadcast (ToListID, FromEmail, FromName, Subject, TextMessage, HTMLMessage, TimeAdded, TimeSent, ReplyTo)" strSQL = strSQL & " VALUES ('2','myemail2@domain.com','my name2','Subject2','Text2','HTML2','9/8/2001 5:09:18 PM','9/8/2001 5:09:18 PM','James2')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Broadcast (ToListID, FromEmail, FromName, Subject, TextMessage, HTMLMessage, TimeAdded, TimeSent, ReplyTo)" strSQL = strSQL & " VALUES ('3','myemail3@domain.com','my name3','Subject3','Text3','HTML3','9/8/2001 5:09:18 PM','9/8/2001 5:09:18 PM','James3')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Lists (Listname) VALUES ('TestList')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Lists (Listname) VALUES ('TestList2')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Lists (Listname) VALUES ('TestList3')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Prefs (RemoveURL, DefaultEmail, MailerPath, ListName, MailerProgram, SendSubscribe, SendUnsubscribe, MLVersion)" strSQL = strSQL & " VALUES ('RemoveURL','jharris@pensaworks.com','mail.pensaworks.com','James Test','CDOMail','1','1','2.0')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Users (Username, MyPassword, Usr, Admin, Broadcast, Prefs, Master, RealName, RealEmail)" strSQL = strSQL & " VALUES ('JHarris','1937','Y','Y','Y','Y','Y','James1','James1@pensaworks.com')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Users (Username, MyPassword, Usr, Admin, Broadcast, Prefs, Master, RealName, RealEmail)" strSQL = strSQL & " VALUES ('James2','pass2','Y','Y','Y','Y','N','James2','James2@pensaworks.com')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Users (Username, MyPassword, Usr, Admin, Broadcast, Prefs, Master, RealName, RealEmail)" strSQL = strSQL & " VALUES ('James3','pass3','Y','Y','Y','Y','N','James3','James3@pensaworks.com')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Subscribers (Name, Subscribed, Email, Format, ListID)" strSQL = strSQL & " VALUES ('James1','" & Now & "','jharris1@pensaworks.com','Text','1')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Subscribers (Name, Subscribed, Email, Format, ListID)" strSQL = strSQL & " VALUES ('James2','" & Now & "','jharris2@pensaworks.com','Text','2')" dbConn.Execute (strSQL) strSQL = "INSERT INTO ML_Subscribers (Name, Subscribed, Email, Format, ListID)" strSQL = strSQL & " VALUES ('James3','" & Now & "','jharris3@pensaworks.com','Text','3')" dbConn.Execute (strSQL) %> <% End If %> <% If Action = "Install30" Then %> Version 3.0 tables installed. Back to the Main Page. <% Results = Create_30() ' install version 3.0 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' %> <% end if %> <% If Action = "Install31" Then %> Version 3.0 tables installed. Back to the Main Page. <% Results = Create_31() ' install version 3.0 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' %> <% End If %> <% If Action = "SaveSubscribers" Then I = 0 set rs1 = Server.CreateObject("ADODB.Recordset") rs1.ActiveConnection = mlConn rs1.Source = "SELECT * FROM ML_Subscribers" rs1.CursorType = 1 rs1.CursorLocation = 3 rs1.LockType = 3 rs1.Open() rs1Num = rs1.RecordCount %> ListID|Name|Email Address|Format
<% For I = 1 to rs1Num %> <%=rs1("ListID")%>|<%=rs1("name")%>|<%=rs1("Email")%>|<%=rs1("Format")%>
<% rs1.MoveNext Next End If %>



Spd E-Letter v4.0
© 2001-2002, PensaWorks