%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim cn : Set cn = Server.CreateObject("ADODB.Connection")
'-------------------------------
' Create database connection string, login and password variables
'-------------------------------
Dim strConn, strLogin, strPassword
strConn = "Driver={MySQL};DATABASE=fairla2_xmb3;UID=fairla2_issue;PASSWORD=coconuts"
'-------------------------------
' Open the connection
'-------------------------------
%>
Fair Lakes Condominium
<%
success = 0
If "Delete"=Request("ActionType") Then
Set cn = Server.CreateObject("ADODB.Connection")
cn.open strConn
sqlEmail = "Select * from EMAIL_SUBSCRIPTIONS where EMAIL_ADDRESS = '"&Request.Form("email")&"'"
set RSEmail = Server.CreateObject("ADODB.Recordset")
RSEmail.open sqlEmail, cn
'if RSEmail.eof or Request.Form("email")="" then
If Request.Form("email") = "" Then
Response.Write("No e-mail address entered.
Please enter the email address to unsubscribe.")
ElseIf RSEmail.RecordCount = 0 Then
Response.Write("E-Mail Address Not Subscribed.
The e-mail address you entered was not subscribed to the mailing list.")
Elseif RSEmail.RecordCount > 0 then
sql = "DELETE FROM EMAIL_SUBSCRIPTIONS WHERE EMAIL_ADDRESS = '"& Request.Form("email")&"'"
'Response.Write(sql&"
")
response.write ("You have been unsubscribed.
A confirmation email will be sent to you shortly.
Return to the Fair Lakes Condominium Home Page")
cn.Execute sql
'Send the unsubscriber a confirmation email
mailBody = "Your request to be unsubscribed from the Fair Lakes Condominium Association e-mail list has been received.
You may subscribe at any time by visiting http://www.FairLakesCondo.com/subscribe.asp."
Set newMsg = CreateObject("CDONTS.NewMail")
newMsg.BodyFormat=0
newMsg.From="Fair Lakes Condo Association "
newMsg.To=Request.Form("email")
newMsg.Subject = "Unsubscribe Request Received"
newMsg.Body = mailBody
newMsg.Send
'Send me a copy for debugging purposes.
mailBody2 = Request.Form("email") & " has unsubscribed from the FLCA e-mail list."
Set newMsg2 = CreateObject("CDONTS.NewMail")
newMsg2.BodyFormat=0
newMsg2.From="Fair Lakes Condo Association "
newMsg2.To="robb.moskowitz@fairlakescondo.com"
newMsg2.Subject = "Unsubscribe Request"
newMsg2.Body = mailBody2
newMsg2.Send
success = 1
End If
RSEmail.close
cn.close
End If
'Else
If success = 0 Then
%>
Unsubscribe from the Fair Lakes Condominium Association E-Mail List
<%
End If
%>