<% objConnOpen strEmail = Trim(Request("email")) strConfirm = Trim(Request("confirm")) If strConfirm = "yes" Then 'confirm the subscription strSQL = "UPDATE newsletter SET confirm = '"&strConfirm&"' WHERE email = '"&strEmail&"'" objConn.Execute strSQL Response.Write "


" & _ "" & _ "Success! " & strEmail & " has been confirmed!" & _ "

Thank you for subscribing to the " & strSiteTitle & " newsletter

" ElseIf strConfirm = "no" Then 'New subscriber strEmail = Trim(Request.Form("email")) Set rsNews = objConn.Execute("SELECT * FROM newsLetter WHERE email = '"&strEmail&"'") If Not rsNews.EOF Then Response.Write "
This email address is already subscribed!
" Else strSQL = "INSERT INTO newsletter ([email],[Date],[confirm]) VALUES('" & strEmail & "','" & Now & "','" & strConfirm & "')" objConn.Execute strSQL Set rsNews = Server.CreateObject("ADODB.Recordset") rsNews.Open "newsLetter", objConn, 0, 3, &H0002 subject = strSiteTitle & " Newsletter confirmation" 'send email so subscriber can confirm strEmailMsg = "Thank you for subscribing to the " & strSiteTitle & " Newsletter

" & _ "Please confirm your subscription by clicking on the link below.

" & _ "" & _ "confirm

" & _ "You received this email because you submitted this email address to our mailing list.
" & _ "If you did not subscribe or wish to be removed from our list - click on the link below

" & _ "" & _ "unsubscribe

" & _ "Our Thanks
" & strSiteTitle 'Send email based on mail component. 'Send email (CDONTS version). Note: CDONTS doesn't support a reply-to 'address and has no error checking. If mailComp = "CDONTS" Then Set mailObj = Server.CreateObject("CDONTS.NewMail") mailObj.BodyFormat = 0 mailObj.MailFormat = 0 mailObj.From = fromAddr mailObj.To = strEmail mailObj.Subject = subject mailObj.Body = strEmailMsg mailObj.Send Set mailObj = Nothing End If 'Send email (CDOSYS version). If mailComp = "CDOSYS" Then Set cdoMessage = Server.CreateObject("CDO.Message") Set cdoConfig = Server.CreateObject("CDO.Configuration") cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = fromAddr cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "tufwfo" cdoConfig.Fields.Update Set cdoMessage.Configuration = cdoConfig cdoMessage.From = "" & strSiteTitle & " <" & fromAddr & ">" cdoMessage.To = strEmail cdoMessage.Subject = subject cdoMessage.HtmlBody = strEmailMsg On Error Resume Next cdoMessage.Send If Err.Number <> 0 Then Response.Write = "Email send failed: " & Err.Description & "." Set cdoMessage = Nothing Set cdoConfig = Nothing End If 'Send email (JMail version). If mailComp = "JMail" Then Set mailObj = Server.CreateObject("JMail.SMTPMail") mailObj.Silent = True mailObj.ServerAddress = smtpServer mailObj.Sender = fromAddr mailObj.SenderName = strSiteTitle mailObj.ReplyTo = fromAddr mailObj.Subject = subject mailObj.AddRecipient strEmail mailObj.ContentType = "text/html" mailObj.Body = strEmailMsg If not mailObj.Execute Then Response.Write "Email send failed: " & mailObj.ErrorMessage & "." End If 'Send email (ASPMail version). If mailComp = "ASPMail" Then Set mailObj = Server.CreateObject("SMTPsvg.Mailer") mailObj.FromName = strSiteTitle mailObj.FromAddress = fromAddr mailObj.RemoteHost = smtpServer mailObj.ReplyTo = fromAddr mailObj.AddRecipient strEmail mailObj.Subject = subject mailObj.ContentType = "text/html" mailObj.BodyText = strEmailMsg If Not mailObj.SendMail Then Response.Write "Email send failed: "&mailObj.Response & "." End If If mailComp = "AspEmail" Then Set mailObj = Server.CreateObject("Persits.MailSender") mailObj.Host = smtpServer mailObj.From = fromAddr mailObj.FromName = strSiteTitle mailObj.AddAddress strEmail mailObj.Subject = subject mailObj.Body = strEmailMsg mailObj.IsHTML = True On Error Resume Next SKF_MailMember.Send If Err <> 0 Then Response.Write "Email send failed: "&Err.Description Set mailObj = Nothing End If Response.Write "


" & _ "" & _ "An email has been sent to:

" & strEmail & "

" & _ "Confirm your subscription by following the instructions in the email" & _ "

Thank for subscribing to the " & strSiteTitle & " Newsletter
" End If rsNews.Close Set rsNews = Nothing Else If Request("cancel") = "yes" Then strEmail = Request("email") If Instr(strEmail,"@") = 0 OR Instr(strEmail,".") = 0 Then Response.Redirect "process.asp?msg=notvalidaddy" Else Set rsNews = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM newsLetter WHERE email = '" & strEmail & "';" rsNews.Open strSQL, objConn, 0, 3, &H0001 If not rsNews.EOF Then rsNews.Delete Response.Write "


" & _ "" & _ " Success! " & strEmail & " has been removed from our database" & _ "

Sorry to see you go!
" Else Response.Redirect "process.asp?msg=notfound" End If rsNews.Close Set rsNews = Nothing End If Else %>
<% strMsg = Trim(Request.QueryString("msg")) em = Trim(Request.QueryString("em")) If strMsg <> "" Then Response.Write "

"&vbcrlf Response.Write ""&vbcrlf If strMsg = "notvalidaddy" Then Response.Write "You Must enter a valid Email address!"&vbcrlf ElseIf strMSG = "notfound" Then Response.Write "The Email address you entered ("&em&") was not found in our database!" End If Response.Write ""&vbcrlf End If %>

Enter the email address you want removed.
<% End If End If %>
 
<% objConnClose %>