<% 'BEGIN CODE FOR EMAIL LIST MANAGEMENT 'helper ASP function definitions %> <% dim strFormAction dim strEmailSuccess dim strBody dim strBodyTop dim strBodyBottom dim strFromAddress dim strFromName dim strToName dim strToAddress dim strSubject dim strEmail dim strEmailID dim strConfirmEmailURL dim strConfirmPage dim strListID dim objConn dim strSQL dim objRS dim blnShowForm dim strSuccessMessage 'CUSTOMIZE THESE VALUES FOR THE PARTICULAR SITE: strListID = "5" strConfirmPage = "http://mule.net/addemail_confirm.asp?strEmailID=" strSuccessMessage = "You will receive an email to confirm your subscription to the Gov't Mule Announcement list." strFromAddress = "info@hardhead.com" strFromName = "Gov't Mule" strSubject = "Subscription Confirmation" strBodyTop = "We have received a request from you to sign up for the Gov't Mule Announcement list. In order to ensure that you signed up for this list on purpose, click on the link below or paste it into your browser to confirm subscription." strBodyBottom = "Thanks" & vbCrLf & vbCrLf & "Gov't Mule" strEmail = Request.QueryString("strEmail") strFormAction = "joinemail" 'start processing form select case strFormAction case "joinemail" strEmail = Trim(Request.Form("strEmail")) if strEmail <> "" then if VerifyEmailAddressFormatting(strEmail) and (strEmail <> "email@yourdomain.com") then 'email address is OK 'build stored proc call strSQL = "hosted_site_customer_email_insert" strSQL = strSQL & " @customer_email = '" & strEmail & "'" strSQL = strSQL & ",@hosted_site_id = " & strListID 'connect to database and get new email id set objConn = Server.CreateObject("ADODB.Connection") objConn.Open(Application("strDBConnectionUsremail")) set objRS = Server.CreateObject("ADODB.Recordset") set objRS = objConn.Execute(strSQL) strEmailID = objRS.Fields("inserted_id").Value 'close database objects objConn.Close set objConn = nothing set objRS = nothing 'customize the email strToName = strEmail strToAddress = strEmail strConfirmEmailURL = strConfirmPage & strEmailID strBody = strBodyTop & vbCrLf & vbCrLf & strConfirmEmailURL & vbCrLf & vbCrLf & strBodyBottom 'send email strEmailSuccess = SendEmail(strToName,strToAddress,strFromName,strFromAddress,strSubject,strBody) if strEmailSuccess <> "Success" then blnShowForm = true else strEmailSuccess = strSuccessMessage blnShowForm = false end if else 'email address is not OK strEmailSuccess = "Your email address was not formatted correctly." blnShowForm = true end if else 'all fields are not filled in strEmailSuccess = "You did not enter an email address." blnShowForm = true end if 'checking to make sure all fields are filled out case else blnShowForm = true end select 'END CODE FOR EMAIL LIST MANAGEMENT %> Mule.net: Contact


<% 'BEGIN FORM CODE AND SUCCESS/FAILURE MESSAGE CODE if strEmailSuccess <> "" then %> <% =strEmailSuccess %> <% end if if blnShowForm then %>
" method="post" id=form1 name=form1> Join the Announcement list
Please enter your email address below to subscribe to the Gov't Mule Announcement list.
Joining this list will entitle you to the most up-to-date Mule info there is.
spacer.gif" width="1" height="5">
spacer.gif" width="10" height="1">Submit_button.gif" align="absmiddle" border="0" id=image1 name=image1>
<% end if 'END FORM CODE AND SUCCESS/FAILURE MESSAGE CODE %>