<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "33, 359, 402, 469, 684, 685, 1124, 1125, 1126, 1127, 1128" strThisBackPage = "config" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== %> <% =GetString("Config_headtitle") %>
<% WriteString("PageTitle_MailingListSend") %>
<% server.scripttimeout = 3000 strSubject = sqlsafe(request.form("subject")) & "" 'Get site and URL for replacement SiteName = GetString("Config_Webshopname") SiteURL = Application(LICENSENUMBER & "webshopURL") 'GET TEXT strTextMessage = sqlsafe(request.form("textmessage")) & "" strTextMessage = replace(replace(strTextMessage,"xxxWEBSHOPNAMExxx",SiteName),"xxxWEBSHOPURLxxx",SiteURL) strHTMLMessage = sqlsafe(request.form("htmlmessage")) & "" strHTMLMessage = replace(replace(strHTMLMessage,"xxxWEBSHOPNAMExxx",SiteName),"xxxWEBSHOPURLxxx",SiteURL) strTextFooter = GetString("EmailText_NewsletterFooterText") strTextFooter = replace(replace(strTextFooter,"xxxWEBSHOPNAMExxx",SiteName),"xxxWEBSHOPURLxxx",SiteURL) strHTMLFooter = GetString("EmailText_NewsletterFooterHTML") strHTMLFooter = replace(replace(strHTMLFooter,"xxxWEBSHOPNAMExxx",SiteName),"xxxWEBSHOPURLxxx",SiteURL) numMailingLanguage = request.form("ML_Language") if strTextMessage = "" then SkipText = true if strHTMLMessage = "" then SkipHTML = true test = request.form("test") if SkipText and SkipHTML then strErrorText = "
  • " & GetString("ContentText_BothEmailsBlank") & vbcrlf if strSubject = "" then strErrorText = strErrorText & "
  • " & GetString("ContentText_SubjectFieldBlank") & vbcrlf if strErrorText = "" then '------------------------------------ 'Get the application variables we will need '------------------------------------ EmailMethod = Application(LICENSENUMBER & "emailmethod") MailServer = Application(LICENSENUMBER & "mailserver") OwnerFromEmail = strEmailFrom OwnerToEmail = strEmailTo OwnerName = GetString("Config_OwnerName") SubjectLine = GetString("Config_Subjectline3") %> <% If test = "y" Then strTextMessage = replace(strTextMessage & chr(13) & chr(13) & strTextFooter,"xxxIPADDRESSxxx","(testIP)") strHTMLMessage = replace(strHTMLMessage & "

    " & strHTMLFooter,"xxxIPADDRESSxxx","(testIP)") '----------------------------- 'TEST MAIL TO ADMIN '----------------------------- if not SkipText then Call SendEMail(emailmethod,mailserver,ownertoemail,"","",OwnerFromEmail,OwnerName,OwnerFromEmail,OwnerName,strSubject,strTextMessage,"",false) response.write "" & chr(13) response.write " " & vbcrlf response.write " " & vbcrlf response.write "" & chr(13) end if if not SkipHTML then Call SendEMail(emailmethod,mailserver,ownertoemail,"","",OwnerFromEmail,OwnerName,OwnerFromEmail,OwnerName,strSubject,strHTMLMessage,"",true) response.write "" & chr(13) response.write " " & vbcrlf response.write " " & vbcrlf response.write "" & chr(13) end if Else '----------------------------- 'MAIL EVERYONE '----------------------------- '----------------------------- 'PULL OUT ALL SIGNUPS '----------------------------- strQuery = "SELECT * FROM tblCactuShopMailingList WHERE ML_Authorized = 'y' AND ML_Language = " & numMailingLanguage & " ORDER BY ML_ID DESC" Call ExecuteSQL(strQuery, numCursorType, objRecordSet) Do While Not objRecordSet.EOF ML_IP = objRecordSet("ML_IP") & "" if objRecordSet("ML_HTML") = "y" then If ML_IP = "" then strMessageToSend = strHTMLMessage & "" Else strMessageToSend = strHTMLMessage & "

    " & strHTMLFooter End If strTypeSent = GetString("ContentText_HTML") blnIsHTML = true else If ML_IP = "" then strMessageToSend = strTextMessage & "" Else strMessageToSend = strTextMessage & chr(13) & chr(13) & strTextFooter End If strTypeSent = GetString("ContentText_PlainText") blnIsHTML = false end if If (blnIsHTML And Not SkipHTML) OR (Not blnIsHTML And Not SkipText) then strMessageToSend = replace(strMessageToSend & "","xxxIPADDRESSxxx",ML_IP) Call SendEMail(emailmethod,mailserver,objRecordSet("ML_Email"),"","",OwnerFromEmail,OwnerName,OwnerFromEmail,OwnerName,strSubject,strMessageToSend,"",blnIsHTML) '----------------------------- 'MARK LAST EMAILED DATE IN DB '----------------------------- strQuery2 = "UPDATE tblCactuShopMailingList SET ML_LastEmailed = " & strDateDelimiter & ReverseFormatYear(Now) & strDateDelimiter & " WHERE ML_ID = " & objRecordSet("ML_ID") Call ExecuteSQL(strQuery2, numCursorType, objRecordSet2) '----------------------------- 'WRITE TABLE LOG '----------------------------- response.write "" & chr(13) response.write " " & vbcrlf response.write " " & vbcrlf response.write "" & chr(13) end if objRecordSet.movenext loop objRecordSet.close End if Else response.write GetString("ContentText_PleaseGoBackAndCorrect") & "
      " & strErrorText & "
    << " & GetString("ContentText_BackLink") & "" End if objDataConn.Close set objDataConn = nothing %>
    <% WriteString("ContentText_EmailLog") %>
    " & ownertoemail & "" & GetString("ContentText_PlainText") & "
    " & ownertoemail & "" & GetString("ContentText_HTML") & "
    " & objRecordSet("ML_Email") & "" & strTypeSent & "