<%@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 - Mailing List
<% success = 0 If "Insert"=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("name") = "" Then Response.Write("

No name entered.

Please enter your name.") ElseIf Request.Form("email") = "" Then Response.Write("

No e-mail address entered.

Please enter a valid email address.") Elseif RSEmail.RecordCount > 0 then response.write ("

The e-mail address you entered is already subscribed to the mailing list.

") ElseIf Left(Request.Form("address_number"), 2) <> "12" Then Response.Write("

The address number is not valid.") ElseIf NOT IsNumeric(Request.Form("address_number")) Then Response.Write("

The address number is not valid.") ElseIf NOT IsNumeric(Request.Form("unit_number")) AND NOT Request.Form("unit_number") = "" Then Response.Write("

The unit number is not valid.") ElseIf InStr(1, Request.Form("email"), "@", vbTextCompare) = 0 Then response.write ("

Invalid E-Mail Address.

The e-mail address you entered is invalid.") Else sql = "Insert Into EMAIL_SUBSCRIPTIONS (NAME , ADDRESS_NUMBER, UNIT_NUMBER, EMAIL_ADDRESS, SUBSCRIBE_DATE) "&_ "Values ( '"& Request.Form("name") &"', '"&Request.Form("address_number")&"', '"&Request.Form("unit_number")&"', '"&Request.Form("email")&"', DATE_ADD(SYSDATE(), INTERVAL 3 HOUR))" 'Response.Write(sql&"
") response.write ("

Thank You For Subscribing.

A confirmation email will be sent to you shortly.

Return to the Fair Lakes Condominium Home Page

") cn.Execute sql 'Send the new subscriber a confirmation email mailBody = "Your request to be subscribed to the Fair Lakes Condominium Association e-mail list has been received.
You may unsubscribe at any time by visiting http://www.FairLakesCondo.com/unsubscribe." Set newMsg = CreateObject("CDONTS.NewMail") newMsg.BodyFormat=0 newMsg.From="Fair Lakes Condo Association " newMsg.To=Request.Form("email") newMsg.Subject = "Subscription Request Received" newMsg.Body = mailBody newMsg.Send 'Send me a copy for debugging purposes. mailBody2 = Request.Form("email") & " has subscribed to 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 = Request.Form("address_number") & " Subscription " newMsg2.Body = mailBody2 & "
IP:" & Request.ServerVariables("REMOTE_ADDR") newMsg2.Send success = 1 End If RSEmail.close cn.close End If 'Else If success = 0 Then %>


Subscribe to the Fair Lakes Condominium Association E-Mail List

Name:

Unit Number: #

E-Mail Address:

Looking to unsubscribe?

<% End If %>