<%@LANGUAGE="VBSCRIPT"%> <% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Spd E-Letter v4 ' © 2001, 2002 PensaWorks, inc. ' For help with this program, please visit http://www.pensaworks.com '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim Access : Access = "Broadcast" Dim Nav3 : Nav3 = "5" %> <% response.buffer = true server.scripttimeout = 1 if (request("msgID") <> "" AND IsNumeric(request("msgID"))) then MessageID = request("msgID") else MessageID = 0 set msgRecord = server.createobject("ADODB.Recordset") msgRecord.activeconnection = mlConn msgRecord.source = "SELECT ML_Broadcast.ListID AS msgListID, * FROM ML_Broadcast INNER JOIN ML_Lists ON ML_Lists.ListID = ML_Broadcast.ListID WHERE ML_Broadcast.MessageID = " & MessageID msgRecord.cursortype = 3 msgRecord.open() if msgRecord.EOF then response.redirect "message.asp?msg=20" elseif msgRecord("Status") <> "Pending" then response.redirect "message.asp?msg=30" end if if not allowedList(msgRecord("msgListID"), allowedLists) then response.redirect "message.asp?msg=49" if msgRecord("msgIncludeTemplateText") = 1 then msgTextHeader = msgRecord("HeaderText") : msgTextFooter = msgRecord("FooterText") end if if msgRecord("msgIncludeTemplateHTML") then msgHTMLHeader = msgRecord("HeaderHTML") : msgHTMLFooter = msgRecord("FooterHTML") end if ' newsletter settings msgStatus = msgRecord("Status") if (lcase(msgStatus) = "broadcasted") then response.redirect "message.asp?msg=" msgListID = msgRecord("msgListID") msgListName = msgRecord("ListName") msgFormat = msgRecord("msgFormat") msgSubject = msgRecord("Subject") msgFromName = msgRecord("FromName") msgFromEmail = msgRecord("FromEmail") msgReplyTo = msgRecord("ReplyTo") msgText = msgRecord("TextMessage") msgHTML = msgRecord("HTMLMessage") msgSourceFileText = msgRecord("msgSourceFileText") msgSourceFileHTML = msgRecord("msgSourceFileHTML") msgSourceURLText = msgRecord("msgSourceURLText") msgSourceURLHTML = msgRecord("msgSourceURLHTML") msgSourceTextTimes = msgRecord("msgSourceTextTimes") msgSourceHTMLTimes = msgRecord("msgSourceHTMLTimes") msgUseSQL = msgRecord("msgUseSQL") msgSQLStr = msgRecord("msgSQLStr") msgSource = msgRecord("msgSource") noTextMessage = false noHTMLMessage = false noTextURL = false noHTMLURL = false noTextFile = false noHTMLFile = false noSQL = false noSQLerr = false totalSubscribers = 0 if msgUseSQL = 2 then if msgSQLStr = "" then noSQLerr = true sqlErr = "No SQL Query" else set usrRecord = server.createobject("ADODB.Recordset") usrRecord.activeconnection = mlConn usrRecord.source = msgSQLStr usrRecord.cursortype = 3 usrRecord.open() if err.number <> 0 then noSQLerr = true sqlErr = err.description else totalSubscribers = usrRecord.recordcount end if end if else SQL = "SELECT * FROM ML_Subscribers WHERE subRemoved <> 1" &_ " AND numClicks >= " & msgRecord("msgLowClicksF") & " AND numClicks <= " & msgRecord("msgHighClicksF") &_ " AND SubscribedDate >= " & msgRecord("msgSinceDateF") & " AND SubscribedDate <= " & msgRecord("msgToDateF") &_ " AND numReads >= " & msgRecord("msgLowReadsF") & " AND numReads <= " & msgRecord("msgHighReadsF") &_ " AND ListID = " & msgListID &_ " ORDER BY SubscriberID ASC" set usrRecord = server.createobject("ADODB.Recordset") usrRecord.activeconnection = mlConn usrRecord.source = SQL usrRecord.cursortype = 3 usrRecord.open() totalSubscribers = usrRecord.recordcount end if ' do validation checks... if msgSource = 3 then if msgFormat = 1 or msgFormat = 2 then msgText = getNewsletterData("Text", 0, "email@domain.com", "True", msgSourceURLText, bitResponse) ' check for error... if (NOT bitResponse) then noTextMessage = true noTextURL = true end if end if ' set HTML newsletter data if msgFormat = 1 or msgFormat = 3 then msgHTML = getNewsletterData("HTML", 0, "email@domain.com", "True", msgSourceURLHTML, bitResponse) ' check for error... if (NOT bitResponse) then noHTMLMessage = true noHTMLURL = true end if end if elseif msgSource = 2 then ' set Text Newsletter data if msgFormat = 1 or msgFormat = 2 then if doesFileExist(msgSourceFileText) then fileData = readFileData(msgSourceFileText, fileResponse) if NOT fileResponse then 'Error reading Text file. noTextMessage = true noTextFile = true else msgText = fileData end if else 'Error: Text File could not be found. noTextMessage = true noTextFile = true end if end if ' set HTML newsletter data if msgFormat = 1 or msgFormat = 3 then if doesFileExist(msgSourceFileHTML) then fileData = readFileData(msgSourceFileHTML, fileResponse) if NOT fileResponse then 'Error reading HTML file. noHTMLMessage = true noHTMLFile = true else msgHTML = fileData end if else 'Error: HTML File could not be found. noHTMLMessage = true noHTMLFile = true end if end if elseif msgSource = 1 then msgText = trim(msgRecord("TextMessage")) msgHTML = trim(msgRecord("HTMLMessage")) else noTextMessage = true noHTMLMessage = true end if if (msgFormat = 1 or msgFormat = 2) then if (msgText = "") then noTextMessage = true badTextSnippets = snippetCheck(msgText) end if if (msgFormat = 1 or msgFormat = 3) then if msgHTML = "" then noHTMLMessage = true badHTMLSnippets = snippetCheck(msgHTML) end if badURLText1 = countOccurances(msgText, "%5Burl%5D") badURLText2 = countOccurances(msgText, "%5Burl]") badURLText3 = countOccurances(msgText, "[url%5D") badURLText4 = countOccurances(msgText, "%5B/url%5D") badURLText5 = countOccurances(msgText, "%5B/url]") badURLText6 = countOccurances(msgText, "[/url%5D") badURLText = badURLText1 + badURLText2 + badURLText3 + badURLText4 + badURLText5 + badURLText6 badURLHTML1 = countOccurances(msgHTML, "%5Burl%5D") badURLHTML2 = countOccurances(msgHTML, "%5Burl]") badURLHTML3 = countOccurances(msgHTML, "[url%5D") badURLHTML4 = countOccurances(msgHTML, "%5B/url%5D") badURLHTML5 = countOccurances(msgHTML, "%5B/url]") badURLHTML6 = countOccurances(msgHTML, "[/url%5D") badURLHTML = badURLHTML1 + badURLHTML2 + badURLHTML3 + badURLHTML4 + badURLHTML5 + badURLHTML6 if msgFormat = 1 or msgFormat = 2 then if noTextFile then errText = 1 else if noTextURL then errText = 2 else if noTextMessage then errText = 3 else errText = 0 end if end if end if else errText = 0 end if if msgFormat = 1 or msgFormat = 3 then if noHTMLFile then errHTML = 1 else if noHTMLURL then errHTML = 2 else if noHTMLMessage then errHTML = 3 else errHTML = 0 end if end if end if else errHTML = 0 end if %> <%=ListName%> - Spd E-Letter Administration

Broadcast Newsletter

<% if errText > 0 or errHTML > 0 or noSQL or noSQLerr or totalSubscribers <= 0 then %>

There were errors with this newsletter which render it unable to be broadcasted. Please check your newsletter for the error(s).

Custom SQL String:
<% if NOT noSQLerr then %>Valid Query<% else %>Invalid Query - <%=sqlErr%><% end if %>
Total Subscribers:
<%=totalSubscribers%>
Text Newsletter:
<% if errText = 3 then %> Missing Data <% elseif errText = 2 then %> Invalid URL <% elseif errText = 1 then %> Invalid File <% else %> No Error <% end if %>
HTML Newsletter:
<% if errHTML = 3 then %> Missing Data <% elseif errHTML = 2 then %> Invalid URL <% elseif errHTML = 1 then %> Invalid File <% else %> No Error <% end if %>
Malformed URL Tracking Tags (Text):
<%=badURLText%>
Malformed URL Tracking Tags (HTML):
<%=badURLHTML%>
Invalid Snippets (Text):
<%=badTextSnippets%>
Invalid Snippets (HTML):
<%=badHTMLSnippets%>
<% else %>

You are about to begin broadcasting the newsletter listed below. Be advised that it is likely that this process will take a significant amount of time to complete. Please be patient while the script sends out individual emails to all subscribers. Please do not hit stop during this time. You must also be online for the process to finish. To assure that there are no errors in your newsletter, please check your newsletter data before continuing.

<% if badURLText > 0 or badURLHTML > 0 or badTextSnippets > 0 or badHTMLSnippets > 0 then %>

Error
The following errors are non-critical but should be corrected if you want all features to function properly.

Malformed URL Tracking Tags (Text):
<%=badURLText%>
Malformed URL Tracking Tags (HTML):
<%=badURLHTML%>
Invalid Snippets (Text):
<%=badTextSnippets%>
Invalid Snippets (HTML):
<%=badHTMLSnippets%>

<% end if %>
Subject:
<%=msgRecord("Subject")%>
Total Subscribers:
<%=totalSubscribers%>
Message:
')">Text Version | ')">HTML Version
Broadcasting to the List:
<%=msgRecord("ListName")%>
From Name:
<%=msgRecord("FromName")%>
From Email:
<%=msgRecord("FromEmail")%>
Reply To:
<%=msgRecord("ReplyTo")%>

I have checked the above newsletter and I am sure that it should be broadcasted now.
"> Force the Broadcast to use:
<% end if %>