<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Spam Filter ISP Forums : SQL Guru Needed!</title>
  <link>https://www.logsat.com/spamfilter/forums/</link>
  <description><![CDATA[This is an XML content feed of; Spam Filter ISP Forums : Spam Filter ISP Support : SQL Guru Needed!]]></description>
  <pubDate>Sat, 06 Jun 2026 10:04:13 +0000</pubDate>
  <lastBuildDate>Thu, 21 Oct 2004 22:44:00 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.logsat.com/spamfilter/forums/RSS_post_feed.asp?TID=4446</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Spam Filter ISP Forums]]></title>
   <url>https://www.logsat.com/spamfilter/forums/forum_images/web_wiz_forums.png</url>
   <link>https://www.logsat.com/spamfilter/forums/</link>
  </image>
  <item>
   <title><![CDATA[SQL Guru Needed! : Hey Ric, when you get a chance,...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4463&amp;title=sql-guru-needed#4463</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=11">kspare</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 10:44pm<br /><br /><P>Hey Ric, when you get a chance, can you fire me an email to <A HREF="mailto:kevin@pare.ca" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">kevin@pare.ca</A> so I can talk to you about this code? The logic is perfect, I just can't get it to work!</P><P>&nbsp;</P><P>Kevin</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 22:44:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4463&amp;title=sql-guru-needed#4463</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Well. I&amp;#039;m looking through...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4461&amp;title=sql-guru-needed#4461</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=11">kspare</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 3:56pm<br /><br />Well. I'm looking through this, Great Idea. I just gotta figure out how to make this work with MS-SQL!! lol]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 15:56:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4461&amp;title=sql-guru-needed#4461</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Well, i&amp;#039;m playing around...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4459&amp;title=sql-guru-needed#4459</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=11">kspare</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 2:27pm<br /><br /><P>Well, i'm playing around with the code, I do want to allow people who have setup an account in spamfilter to turn off notification, right now i'm just playing around with trying to get the web code working so they can turn it on and off lol</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 14:27:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4459&amp;title=sql-guru-needed#4459</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Kevin If you set both of the...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4458&amp;title=sql-guru-needed#4458</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=2">Guests</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 1:27pm<br /><br /><P>Kevin</P><P>If you set both of the new fields (reminder and notify)&nbsp;in the tbllogins table to default to -1, then both messages will automatically be sent.&nbsp; The toggles at the bottom of the listspam page let the users control if they get the messages or not.&nbsp; You can take away the toggle for the reminder message so that they can't turn it off if you'd like.</P><P>-Ric</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 13:27:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4458&amp;title=sql-guru-needed#4458</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Wow, thanks for the quick reply! Just...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4457&amp;title=sql-guru-needed#4457</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=11">kspare</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 1:12pm<br /><br /><P>Wow, thanks for the quick reply!</P><P>Just so I understand this, the auto-notify only sends to people who switch this option on, and autoreminder sends to everyone in the database?</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 13:12:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4457&amp;title=sql-guru-needed#4457</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : OOPS! overflowed.... didn&amp;#039;t...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4456&amp;title=sql-guru-needed#4456</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=2">Guests</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 12:56pm<br /><br /><P>OOPS! overflowed.... didn't realize there was a limit to length of posts... </P><P>Here's the rest:</P><P>&nbsp;</P><P>The following is saved as 'auto_reminder.asp':<BR>--------------------------------------------------------------------------------<BR>&lt;html&gt;<BR>&lt;body&gt;<BR>Sending Reminders to those with messages in queue and reminders tuned on.&lt;br&gt;&lt;br&gt;<BR>&lt;%<BR>X = 0<BR>&nbsp;SQL = "SELECT * FROM tbllogins WHERE Reminder = -1 ORDER BY Email ASC"<BR>&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;IF NOT (rs.eof AND rs.bof) THEN<BR>&nbsp; rs.MoveFirst<BR>&nbsp; DO UNTIL rs.eof<BR>&nbsp;&nbsp; SQL = "SELECT COUNT(*) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" &amp; rs("Email") &amp; "') AND Expire = 0 AND Deliver = 0"<BR>&nbsp;&nbsp; Set rs2 = con.Execute(SQL)<BR>&nbsp;&nbsp; IF clng(rs2("MessageCount")) &gt; 0 THEN<BR>&nbsp;&nbsp;&nbsp; X = X + 1<BR>&nbsp;&nbsp;&nbsp; SendMessage rs("Email"), rs2("MessageCount")<BR>&nbsp;&nbsp;&nbsp; response.write rs("Email") &amp; " has " &amp; rs2("MessageCount") &amp; " messages in queue... reminder sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp; ELSE<BR>&nbsp;&nbsp;&nbsp; response.write rs("Email") &amp; " has 0 messages in queue... reminder NOT sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp; END IF<BR>&nbsp;&nbsp; rs2.close<BR>&nbsp;&nbsp; set rs2 = nothing<BR>&nbsp;&nbsp; rs.MoveNext<BR>&nbsp; LOOP<BR>&nbsp;END IF<BR>response.write "&lt;BR&gt;" &amp; X &amp; " reminder messages sent.&lt;br&gt;&lt;br&gt;&lt;br&gt;" &amp; vbCRLF<BR>response.write "Sending reminders to those with excessive messages in queue (50 or more).&lt;BR&gt;&lt;BR&gt;" &amp; vbCRLF &amp; vbCRLF<BR>X = 0<BR>&nbsp; SQL = "SELECT DISTINCT EmailTo "<BR>&nbsp; SQL = SQL &amp; "FROM tblquarantine "<BR>&nbsp; SQL = SQL &amp; "WHERE Expire = 0 "<BR>&nbsp; SQL = SQL &amp; "ORDER BY EmailTo"<BR>&nbsp; Set rs = con.Execute(SQL)<BR>&nbsp; If rs.EOF Then<BR>&nbsp;&nbsp; Response.Write "&lt;h2&gt;No addresses in database!&lt;/h2&gt;"<BR>&nbsp; Else<BR>&nbsp;&nbsp; rs.movefirst<BR>&nbsp;&nbsp; While Not rs.EOF<BR>&nbsp;&nbsp;&nbsp; EmailTo = lcase(rs("EmailTo"))<BR>&nbsp;&nbsp;&nbsp; OKToMail = True<BR>&nbsp;&nbsp;&nbsp; SQL2 = "SELECT * FROM tbllogins WHERE Email = '" &amp; EmailTo &amp; "'"<BR>&nbsp;&nbsp;&nbsp; Set TestRS = con.Execute(SQL2)<BR>&nbsp;&nbsp;&nbsp; IF not (TestRS.eof AND TestRS.bof) THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp; IF TestRS("Reminder") = "-1" THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OKToMail = False<BR>&nbsp;&nbsp;&nbsp;&nbsp; END IF<BR>&nbsp;&nbsp;&nbsp; END IF<BR>&nbsp;&nbsp;&nbsp; TestRS.close<BR>&nbsp;&nbsp;&nbsp; Set TestRs = nothing<BR>&nbsp;&nbsp;&nbsp; IF OKToMail THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp; SQL = "SELECT COUNT(EmailTo) AS MessageCount FROM tblQuarantine WHERE (lcase(EmailTo) = '" &amp; lcase(EmailTo) &amp; "')"<BR>&nbsp;&nbsp;&nbsp;&nbsp; Set MessageCountRS = con.Execute(SQL)<BR>&nbsp;&nbsp;&nbsp;&nbsp; IF MessageCountRS(0) &gt; 50 THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SendMessage EmailTo, MessageCountRS(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X = X + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.write EmailTo &amp; " has " &amp; MessageCountRS(0) &amp; " messages in queue... reminder sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp;&nbsp;&nbsp; ELSE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.write EmailTo &amp; " has " &amp; MessageCountRS(0) &amp; " messages in queue... reminder NOT sent.&lt;BR&gt;" &amp; vbcrlf&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; END IF<BR>&nbsp;&nbsp;&nbsp; END IF<BR>&nbsp;&nbsp;&nbsp; rs.MoveNext<BR>&nbsp;&nbsp; Wend<BR>&nbsp; END IF<BR>&nbsp; rs.close<BR>&nbsp; set rs = nothing<BR>&nbsp; con.close<BR>&nbsp; set con = nothing<BR>response.write "&lt;BR&gt;" &amp; X &amp; " reminder messages sent foir excessive messages in queue.&lt;br&gt;&lt;br&gt;&lt;br&gt;" &amp; vbCRLF</P><P>SUB SendMessage(strEmail, lMessageCount)<BR>&nbsp;Set rs3 = Server.CreateObject("ADODB.Recordset")<BR>&nbsp;Set rs3.ActiveConnection = con<BR>&nbsp;rs3.CursorType = 1<BR>&nbsp;rs3.LockType = 3<BR>&nbsp;MessageDate = Now<BR>&nbsp;Message = "From: System Administrator &lt;&gt;" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "To: " &amp; strEMail &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Subject: Daily Reminder: You have messages being held in quarantine" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Date: " &amp; FormatDateTime(MessageDate, vbLongDate) &amp; " " &amp; FormatDateTime(MessageDate, vbLongTime) &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Content-Type: text/html;charset=""ISO-8859-1""" &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Your have " &amp; lMessageCount &amp; " messages being held in the quarantine area" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "For your email account '" &amp; strEmail &amp; "'." &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "THESE MESSAGES **MAY** HAVE ALREADY BEEN CLEARED BY THE SYSTEM ADMINISTRATOR FOR YOU" &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Please log into <A HREF="http://(your" CLASS="ASPForums" TITLE="WARNING: URL created by poster. "><A HREF="http://" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">http://</A>(your</A> quarantine website) and check your messages." &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "." &amp; vbCRLF<BR>&nbsp;SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"<BR>&nbsp;rs3.Open(SQL)<BR>&nbsp;rs3.AddNew<BR>&nbsp;rs3("Msg") = Message<BR>&nbsp;rs3.Update<BR>&nbsp;MsgID = rs3("MsgID")<BR>&nbsp;response.write "MsgID= " &amp; msgID &amp; "&lt;BR&gt;" &amp; vbCRLF<BR>&nbsp;rs3.Close<BR>&nbsp;SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"<BR>&nbsp;rs3.Open(SQL)<BR>&nbsp;rs3.AddNew<BR>&nbsp;rs3("EMailFrom") = "System Administrator &lt;&gt;"<BR>&nbsp;rs3("EMailTo") = strEMail<BR>&nbsp;rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"<BR>&nbsp;rs3("MsgID") = MsgID<BR>&nbsp;rs3("MsgDate") = MessageDate<BR>&nbsp;rs3("Expire") = 0<BR>&nbsp;rs3("Deliver") = 1<BR>&nbsp;rs3("RejectDetails") = ""<BR>&nbsp;rs3("RejectID") = 0<BR>&nbsp;rs3("ServerID") = 1<BR>&nbsp;rs3.Update<BR>&nbsp;rs3.Close<BR>&nbsp;Set rs3 = Nothing<BR>END SUB<BR>%&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR>--------------------------------------------------------------------------------</P><P>It's not the cleanest code, I just hacked it together... but I hope this gives you some ideas to help you with your quest.</P><P>Ric Marques<BR>Systems Manager<BR>Chico Community Publishing</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 12:56:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4456&amp;title=sql-guru-needed#4456</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Kevin - I&amp;#039;ve had this working...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4455&amp;title=sql-guru-needed#4455</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=2">Guests</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 12:47pm<br /><br /><P>Kevin -</P><P>I've had this working since I first started using SpamFilterISP.&nbsp; It's dependant on the Windows scheduler (on the SF server) to run one&nbsp;page(auto_notify.asp') in IE hourly during business hours, and a second page('auto_reminder.asp') at 6am each business day.&nbsp; I am not an ISP; I use SF at my business... so this will be different for those of you processing 100's of thousands of messages a day (server load to process these pages, script timeout, etc.)... we average under 10K messages daily.</P><P>Some users are annoyed with messages throughout the day, and just want one reminder in the morning, so I gave them both options (some choose to have both).&nbsp; The morning reminder is limited (you can easily change this) to only notify those with more than 50 messages in the quarantine.</P><P>I modified the 'tbllogins' table to add two fields - 'notify' and 'reminder'. (I'm using MySQL).&nbsp; They are both&nbsp;type 'bool' fields, defaulting to -1 (on).</P><P>At the top of the 'listspam.asp' page I added:<BR>--------------------------------------------------------------------------------<BR>&lt;%<BR>&nbsp;'update the reminder field for this user<BR>&nbsp;IF Request.QueryString("Reminder") = "on" THEN<BR>&nbsp;&nbsp;SQL = "UPDATE tblLogins SET Reminder = -1 WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;ELSEIF Request.QueryString("Reminder") = "off" THEN<BR>&nbsp;&nbsp;SQL = "UPDATE tblLogins SET Reminder = 0 WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;&nbsp;Set rs = con.Execute(SQL)&nbsp;<BR>&nbsp;END IF</P><P>&nbsp;'update the notification field for this user<BR>&nbsp;IF Request.QueryString("Notify") = "on" THEN<BR>&nbsp;&nbsp;SQL = "UPDATE tblLogins SET Notify = -1 WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;ELSEIF Request.QueryString("Notify") = "off" THEN<BR>&nbsp;&nbsp;SQL = "UPDATE tblLogins SET Notify = 0 WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;&nbsp;Set rs = con.Execute(SQL)&nbsp;<BR>&nbsp;END IF<BR>%&gt;<BR>--------------------------------------------------------------------------------</P><P>&nbsp;</P><P>At the bottom of the 'listspam.asp' page, I have added the following:<BR>--------------------------------------------------------------------------------<BR>&lt;%<BR>&nbsp;SQL = "SELECT Reminder FROM tblLogins WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;IF clng(rs("Reminder")) = -1 THEN<BR>&nbsp;&nbsp;response.write "Reminder is &lt;font size=""2"" color=""red""&gt;ON&lt;/font&gt;. Turn Reminder &lt;a href=""ListSpam.asp?Reminder=off""&gt;Off&lt;/a&gt;"&nbsp; &amp; vbCRLF<BR>&nbsp;ELSE<BR>&nbsp;&nbsp;response.write "Reminder is &lt;font size=""2"" color=""red""&gt;OFF&lt;/font&gt;. Turn Reminder &lt;a href=""ListSpam.asp?Reminder=on""&gt;On&lt;/a&gt;"&nbsp; &amp; vbCRLF<BR>&nbsp;END IF<BR>&nbsp;response.write "&amp;nbsp; - - A daily reminder to check your quarantined messages will be sent to you if this feature is turned on.&lt;br&gt;&lt;br&gt;" &amp; vbCRLF</P><P>&nbsp;SQL = "SELECT Notify FROM tblLogins WHERE (Email = '" &amp; EmailTo &amp; "')"<BR>&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;IF clng(rs("Notify")) = -1 THEN<BR>&nbsp;&nbsp;response.write "Auto-Notify is &lt;font size=""2"" color=""red""&gt;ON&lt;/font&gt;. Turn Auto-Notify &lt;a href=""ListSpam.asp?notify=off""&gt;Off&lt;/a&gt;"&nbsp; &amp; vbCRLF<BR>&nbsp;ELSE<BR>&nbsp;&nbsp;response.write "Auto-Notify is &lt;font size=""2"" color=""red""&gt;OFF&lt;/font&gt;. Turn Auto-Notify &lt;a href=""ListSpam.asp?notify=on""&gt;On&lt;/a&gt;"&nbsp; &amp; vbCRLF<BR>&nbsp;END IF<BR>&nbsp;response.write "&amp;nbsp; - - An immediate notification of possible spam will be sent to you if this feature is turned on.&lt;br&gt;" &amp; vbCRLF<BR>%&gt;<BR>--------------------------------------------------------------------------------</P><P>The above&nbsp;code gives the users a 'toggle' to turn on and off their notification messages.</P><P>Next, I have the following saved as 'auto_notify.asp':<BR>--------------------------------------------------------------------------------<BR>&lt;html&gt;&lt;body&gt;<BR>Sending Reminders to those with messages in queue and reminders tuned on.&lt;br&gt;&lt;br&gt;<BR>&lt;%<BR>X = 0<BR>SQL = "SELECT * FROM tbllogins WHERE Notify = -1 ORDER BY Email ASC"</P><P>&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;IF NOT (rs.eof AND rs.bof) THEN<BR>&nbsp;&nbsp;rs.MoveFirst<BR>&nbsp;&nbsp;DO UNTIL rs.eof<BR>&nbsp;&nbsp;&nbsp;SQL = "SELECT COUNT(*) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" &amp; rs("Email") &amp; "') AND Expire = 0 AND Deliver = 0"<BR>&nbsp;&nbsp;&nbsp;Set rs2 = con.Execute(SQL)<BR>&nbsp;&nbsp;&nbsp;IF clng(rs2("MessageCount")) &gt; 0 THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp;X = X + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;SendMessage rs("Email"), rs2("MessageCount")<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write rs("Email") &amp; " has " &amp; rs2("MessageCount") &amp; " messages in queue... notification sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp;&nbsp;END IF<BR>&nbsp;&nbsp;&nbsp;rs2.close<BR>&nbsp;&nbsp;&nbsp;set rs2 = nothing<BR>&nbsp;&nbsp;&nbsp;rs.MoveNext<BR>&nbsp;&nbsp;LOOP<BR>&nbsp;END IF</P><P>response.write "&lt;BR&gt;" &amp; X &amp; " notification messages sent.&lt;br&gt;&lt;br&gt;&lt;br&gt;" &amp; vbCRLF<BR><BR>SUB SendMessage(strEmail, lMessageCount)<BR>&nbsp;Set rs3 = Server.CreateObject("ADODB.Recordset")<BR>&nbsp;Set rs3.ActiveConnection = con<BR>&nbsp;rs3.CursorType = 1<BR>&nbsp;rs3.LockType = 3<BR>&nbsp;'Send message to user by way of the quarantine.<BR>&nbsp;MessageDate = Now<BR>&nbsp;Message = "From:&nbsp;System Administrator&nbsp;&lt;&gt;" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "To: " &amp; strEMail &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Subject: possible SPAM Notification: You have messages being held in quarantine" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Date: " &amp; FormatDateTime(MessageDate, vbLongDate) &amp; " " &amp; FormatDateTime(MessageDate, vbLongTime) &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Content-Type: text/html;charset=""ISO-8859-1""" &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Your have " &amp; lMessageCount &amp; " messages being held in the quarantine area" &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "For your email account '" &amp; strEmail &amp; "'." &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "THESE MESSAGES **MAY** HAVE ALREADY BEEN CLEARED BY THE SYSTEM ADMINISTRATOR FOR YOU" &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "Please log into <A HREF="http://(your" CLASS="ASPForums" TITLE="WARNING: URL created by poster. "><A HREF="http://" CLASS="ASPForums" TITLE="WARNING: URL created by poster. ">http://</A>(your</A> quarantine website) and check your messages." &amp; vbCRLF &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "This message was sent because you turned auto-notification on." &amp; vbCRLF<BR>&nbsp;Message = Message &amp; "." &amp; vbCRLF<BR>&nbsp;SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"<BR>&nbsp;rs3.Open(SQL)<BR>&nbsp;rs3.AddNew<BR>&nbsp;rs3("Msg") = Message<BR>&nbsp;rs3.Update<BR>&nbsp;MsgID = rs3("MsgID")<BR>&nbsp;response.write "MsgID= " &amp; msgID &amp; "&lt;BR&gt;" &amp; vbCRLF<BR>&nbsp;rs3.Close<BR>&nbsp;SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"<BR>&nbsp;rs3.Open(SQL)<BR>&nbsp;rs3.AddNew<BR>&nbsp;rs3("EMailFrom") = "System Administrator &lt;&gt;"<BR>&nbsp;rs3("EMailTo") = strEMail<BR>&nbsp;rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"<BR>&nbsp;rs3("MsgID") = MsgID<BR>&nbsp;rs3("MsgDate") = MessageDate<BR>&nbsp;rs3("Expire") = 0<BR>&nbsp;rs3("Deliver") = 1<BR>&nbsp;rs3("RejectDetails") = ""<BR>&nbsp;rs3("RejectID") = 0<BR>&nbsp;rs3("ServerID") = 1<BR>&nbsp;rs3.Update<BR>&nbsp;rs3.Close<BR>&nbsp;Set rs3 = Nothing<BR>END SUB<BR>%&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR>--------------------------------------------------------------------------------</P><P>Thew following is saved as 'auto_reminder.asp':<BR>--------------------------------------------------------------------------------<BR>&lt;html&gt;<BR>&lt;body&gt;<BR>Sending Reminders to those with messages in queue and reminders tuned on.&lt;br&gt;&lt;br&gt;<BR>&lt;%<BR>X = 0<BR>&nbsp;SQL = "SELECT * FROM tbllogins WHERE Reminder = -1 ORDER BY Email ASC"<BR>&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;IF NOT (rs.eof AND rs.bof) THEN<BR>&nbsp;&nbsp;rs.MoveFirst<BR>&nbsp;&nbsp;DO UNTIL rs.eof<BR>&nbsp;&nbsp;&nbsp;SQL = "SELECT COUNT(*) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" &amp; rs("Email") &amp; "') AND Expire = 0 AND Deliver = 0"<BR>&nbsp;&nbsp;&nbsp;Set rs2 = con.Execute(SQL)<BR>&nbsp;&nbsp;&nbsp;IF clng(rs2("MessageCount")) &gt; 0 THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp;X = X + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;SendMessage rs("Email"), rs2("MessageCount")<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write rs("Email") &amp; " has " &amp; rs2("MessageCount") &amp; " messages in queue... reminder sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp;&nbsp;ELSE<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write rs("Email") &amp; " has 0 messages in queue... reminder NOT sent.&lt;BR&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp;&nbsp;END IF<BR>&nbsp;&nbsp;&nbsp;rs2.close<BR>&nbsp;&nbsp;&nbsp;set rs2 = nothing<BR>&nbsp;&nbsp;&nbsp;rs.MoveNext<BR>&nbsp;&nbsp;LOOP<BR>&nbsp;END IF<BR>response.write "&lt;BR&gt;" &amp; X &amp; " reminder messages sent.&lt;br&gt;&lt;br&gt;&lt;br&gt;" &amp; vbCRLF<BR>response.write "Sending reminders to those with excessive messages in queue (50 or more).&lt;BR&gt;&lt;BR&gt;" &amp; vbCRLF &amp; vbCRLF<BR>X = 0<BR>&nbsp;&nbsp;SQL = "SELECT DISTINCT EmailTo "<BR>&nbsp;&nbsp;SQL = SQL &amp; "FROM tblquarantine "<BR>&nbsp;&nbsp;SQL = SQL &amp; "WHERE Expire = 0 "<BR>&nbsp;&nbsp;SQL = SQL &amp; "ORDER BY EmailTo"<BR>&nbsp;&nbsp;Set rs = con.Execute(SQL)<BR>&nbsp;&nbsp;If rs.EOF Then<BR>&nbsp;&nbsp;&nbsp;Response.Write "&lt;h2&gt;No addresses in database!&lt;/h2&gt;"<BR>&nbsp;&nbsp;Else<BR>&nbsp;&nbsp;&nbsp;rs.movefirst<BR>&nbsp;&nbsp;&nbsp;While Not rs.EOF<BR>&nbsp;&nbsp;&nb]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 12:47:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4455&amp;title=sql-guru-needed#4455</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : No problem  Dan ]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4453&amp;title=sql-guru-needed#4453</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=22">Desperado</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 12:02pm<br /><br /><P>No problem</P><P>&nbsp;</P><P>Dan</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 12:02:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4453&amp;title=sql-guru-needed#4453</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : heh your one step ahead of me...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4452&amp;title=sql-guru-needed#4452</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=11">kspare</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 11:57am<br /><br />heh your one step ahead of me Dan! When you come up with some ideas, could you email me?]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 11:57:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4452&amp;title=sql-guru-needed#4452</guid>
  </item> 
  <item>
   <title><![CDATA[SQL Guru Needed! : Kevin, &amp;#034;can this be done...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4451&amp;title=sql-guru-needed#4451</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=22">Desperado</a><br /><strong>Subject:</strong> 4446<br /><strong>Posted:</strong> 21 October 2004 at 11:53am<br /><br /><P>Kevin,</P><P>"can this be done easily?"&nbsp; I guess that depends on how you define "easily".&nbsp; I need to think about it some more.&nbsp; I will get back to you.&nbsp; However, I do not call myself a "Guru" ... more like a "Hack"</P><P>Dan</P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2004 11:53:00 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=4446&amp;PID=4451&amp;title=sql-guru-needed#4451</guid>
  </item> 
 </channel>
</rss>