% leadIDs = request.form("leadID") set objDB = OpenDatabase(false) SQL = "Update Leads set AdminApproved = 1 where ID in (" & leadIDs & ") AND Active = 1" UpdateDB objDB, SQL SQL = "Select Distinct R.Email from Regions R, Leads L where L.RegionID = R.RegionID AND L.ID in (" & leadIDs & ")" set rsEmails = CreateRecordset(objDB, SQL) while not rsEmails.eof emailto = emailto & rsEmails("Email") & "," rsEmails.movenext wend rsEmails.close set rsEmails = nothing emailto = emailto & "marketing@prominent.us" Set ObjMail = Server.CreateObject("CDO.Message") objMail.to = emailto objMail.from = "website@prominentxtranet.com" objMail.subject = "New Leads Uploaded" objMail.htmlbody = "New leads have been uploaded to the Xtranet. Please login and qualify each lead by add notes AND BY ENSURING THE CORRECT PRIMARY MARKET (Industrial or Municipal).
By clicking the checkboxes of of the updated leads and clicking ""submit to distributor"" the distributor associated with each lead (determined by primary market and zip code) will receive a similar eMail reminding them to login to the xtranet to process their new leads.
http://www.prominentxtranet.com" objMail.send set objMail = nothing response.redirect("../leads.asp") %>