<% 'declare your variables Dim connection1, recordset1 Dim strSQL1, sConnString1 dim strSQL2 dim admin dim fs, ms, ss dim f, m, s set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.OpenTextFile("d:\vote\nvs\Admin_Email.txt",2,true) '***********declare SQL statement that will query the database strSQL1 = "SELECT EMAIL FROM FACULTY;" '*************** an ADO connection and recordset object Set connection1 = Server.CreateObject("ADODB.connection") Set recordset1 = Server.CreateObject("ADODB.Recordset") '*****define the connection string, specify database *** '**********driver and the location of database ******** sConnString1="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("../database/dbNVS.mdb") '*********Open the connection to the database Connection1.Open sConnString1 'Open the recordset object, executing the SQL Recordset1.Open strSQL1, Connection1 set ms=Server.CreateObject("Scripting.FileSystemObject") set m=ms.OpenTextFile("d:\vote\nvs\Admin_message.txt",1,true) set ss=Server.CreateObject("Scripting.FileSystemObject") set s=ss.OpenTextFile("d:\vote\nvs\Admin_subject.txt",1,true) subject=s.readall'setting x_email subject from file s.close message=m.readall'setting x_email message from file m.close 'do while not recordset1.EOF '<<<<---------uncomment to use with whole database 'Response.Write subject 'Response.Write message if ((subject <> "***no subject***") and (message <> "***no input***"))then 'f.WriteLine(recordset1("EMAIL").value) 'towho=recordset1(recordset1("EMAIL").value)'<<<<---------uncomment to use with whole database towho="vote@bennettpc.net"'<<<<---------change to desired sender email fromwho="admin@bennettpc.net"'<<<<---------COMMENT THIS LINE --for testing-- If toWho <> "" THEN sendMail fromWho, toWho, Subject, message END IF end if 'recordset1.MoveNext '<<<<---------uncomment to use with whole database 'loop '<<<<---------uncomment to use with whole database recordset1.Close Set recordset1 = Nothing connection1.Close Set connection1 = Nothing f.close set f = nothing set fs = nothing 'Cleanup for x_email Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing Response.Redirect ("admin_main.asp") %>