<%@LANGUAGE="VBSCRIPT"%> <% Access = "User" : Nav2 = "1" : Nav3 = "2" %> <% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Spd E-Letter v4 ' © 2001, 2002 PensaWorks, inc. ' For help with this program, please visit http://www.pensaworks.com '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' on error resume next response.buffer = true server.scripttimeout = 1000 if (request("Delimiter") = "") then response.redirect("message.asp?msg=23") If (request("ListID") = "") then response.redirect "message.asp?msg=20" ListID = CInt(request("ListID")) if not allowedList(listID, allowedLists) then response.redirect "message.asp?msg=49" chrDel = request("Delimiter") select case chrDel case "c" chrDel = "," case "p" chrDel = "|" case "t" chrDel = chr(9) case "o" if request("OtherDelimiter") <> "" then chrDel = request("OtherDelimiter") else response.redirect("message.asp?msg=23") end if end select dim getType, fileResponse, subLines getType = request("type") formData = request("FormData") if cstr(getType) = "2" then fileResponse = false filePath = request("filePath") fileData = readFileData(filePath, fileResponse) if (not fileResponse) then response.redirect "message.asp?msg=48" subLines = split(fileData, vbNewLine) else subLines = split(formData, vbNewLine) end if if err.number <> 0 then IsErr = true errDesc = err.description errSource = err.source errNum = err.number else IsErr = false end if start = Now dim mlListName set mlListName = mlConn.Execute("SELECT ListName FROM ML_Lists WHERE ListID = " & ListID) if (mlListName.EOF) then response.redirect "message.asp?msg=25" MLListName = mlListName("ListName") %> <%=ListName%> - Import Email Address'

Subsciber Import


<% if IsErr then %>

ERROR!

The following Error Data was received and may help in diagnosing the problem.

Error Number:

<%=errNum%>

Error Source:
<%=errSource%>

Error Description:
<%=errDesc%>

If the above states an 'Overflow' or 'Stack' error, please reduce the size of your import.


<% else %>
Please wait while the import script processes the data, this could take several minutes. Once completed, a confirmation message will be displayed with the results of the import. Only Errors will appear on the page as they occur.

Bad Import Lines Only


Import Line Error
<% dim count, mlRecError, currClr, idxCheck dim totCount, addCount, dupCount, errCount, emlCount, msgCount, delCount totCount = 0 addCount = 0 dupCount = 0 errCount = 0 emlCount = 0 msgCount = 0 delCount = 0 blkCount = 0 dateCount = 0 idxCheck = 0 currClr = true count = 0 for each subLine in subLines mlRecError = "" totCount = totCount + 1 if len(subLine) then info = split(subLine, chrDel) infofields = 0 for each infofield in info infofields = infofields + 1 next if infofields < 3 then mlRecError = "Wrong Delimiter" delCount = delCount + 1 else subName = trim(info(0)) if verifyEmail(info(1)) then subEmail = trim(info(1)) subFormat = verifyFormat(info(2)) if ubound(info) > 2 then if trim(info(3)) <> "" then subDate = trim(info(3)) else subDate = Now end if else subDate = Now end if if isNull(subFormat) then mlRecError = "Invalid Message Type" : msgCount = msgCount + 1 else 'insert goes here set mlCheckDuplicates = mlConn.Execute("SELECT * FROM ML_Subscribers Where Email = '" & Replace(subEmail, "'", "''") & "' AND ListID = " & ListID) If NOT mlCheckDuplicates.EOF Then mlRecError = "Already Subscribed" : dupCount = dupCount + 1 else domain = split(subEmail, "@") : MLDomain = domain(UBound(domain)) set blockedDomain = mlConn.Execute("SELECT * FROM ML_Blocked WHERE blkType = 0 and blkText = '" & replace(MLDomain, "'", "''") & "'") if NOT blockedDomain.EOF then mlRecError = "Blocked Domain" : blkCount = blkCount + 1 else if NOT IsDate(subDate) then mlRecError = "Invalid Subscribe Date" : dateCount = dateCount + 1 else mlConn.Execute("INSERT INTO ML_Subscribers (Name, Email, Format, ListID, SubscribedDate, numClicks, numReads, numBounces, numReplies, subRemoved, subRemovedDate, subMessageID) VALUES ('" & Replace(subName, "'", "''") & "','" & Replace(subEmail, "'", "''") & "','" & subFormat & "','" & ListID & "'," & getNumFromDate(subDate) & ",0,0,0,0,0,0,0)") addCount = addCount + 1 end if end if end if set mlCheckDuplicates = nothing end if else mlRecError = "Invalid E-Mail" emlCount = emlCount + 1 end if end if end if if mlRecError <> "" then currClr = not currClr errCount = errCount + 1 %>>
<%=subLine%><%=mlRecError%>
<% end if response.flush() next if errCount = 0 then currClr = not currClr %>
There were no errors.
<% end if %>

Subscriber Import Results

Subscriber import completed in <%=DateDiff("s", start, Now)%> seconds.
<%=addCount%> successful subscriptions to "<%=mlListName%>" out of <%=totCount%> total import lines.
<%=errCount%> errors (not subscribed, listed above).
<%=dupCount%> duplicate records.
<%=emlCount%> invalid e-mails.
<%=blkCount%> blocked domains.
<%=msgCount%> invalid Format types.
<%=dateCount%> invalid Subscribe dates.
<%=msgCount%> delimiter errors (wrong delimiter).
<% end if %>
<% set mlConn = nothing set mlListName = nothing set mlCheckDuplicates = nothing set blockedDomain = nothing %>