These are the current Allegro Administration Email .asp files. There are some additional Filters I will not be including here. The different *.asp files I am separating by a line of "*".

PLEASE NOTE that unless you run NT and are connected to the actual Data Base, the files will not display any values. The SOURCE is seen in the View Menu , Source in full, which is the aim of this file.

Please Login

<% Dim objSession ' create session object to connect to mailbox Set objSession = CreateObject("CDONTS.newmail") objSession.Send "emailstring@here.com", "vmaleeva@ottawa.williscollege.com","test","Hello" Response.Write time %>
User Name:
E-mail Address:


E-MAILING LIST
From:

To:
Cc:
Bcc:
Subject:
Importance: High Normal Low
Attach File: No Yes
Format: Plain Text RTF
Message:

Send another message with With Plain Text Features, reset to RTF, or insert the path for an ATTACHMENT
<% Dim objMsg, strFrom, strTo, strCc, strBcc, strSubject, strBody, lngImportance, lngAttachFile, lngMailFormat strFrom = Trim(Request.Form("From")) strTo = Trim(Request.Form("To")) strCc = Trim(Request.Form("Cc")) strBcc = Trim(Request.Form("Bcc")) strSubject = Trim(Request.Form("Subject")) strBody = Trim(Request.Form("Message")) lngAttachFile = Trim(Request.Form("optAttachfile")) lngMailFormat = Trim(Request.Form("MailFormat")) lngImportance = Trim(Request("optImportance")) Set objMsg = Server.CreateObject("CDONTS.NewMail") objMsg.From = strFrom objMsg.To = strTo objMsg.Subject = strSubject objMsg.Body = strBody objMsg.Importance = lngImportance objMsg.Cc = strCc objMsg.Bcc = strBcc objMsg.AttachFile ' insert location and file name like : objMsg.Attachfile "c:\boot.ini" onjMsg.MailFormat = CdoMailFormatTEXT 'I am using this as default, but can be reset to the commented line below: ' objMsg.MailFormat = CdoMailFormatMIME ' this transfers the message from plain txt or CdoMailFormatText to RTF. Could be reset back. objMsg.Send 'This can be sent in one line: 'objMsg.Send strFrom, strTo, strCc, strBcc, strAttachfile, strSubject, strBody, strMailFormat, lngImportance. . . Set objMsg = Nothing WriteHTML("CONFIRMATION: the following message was sent via CDO for NTS:") WriteHTML("From: " &strFrom) WriteHTML("To: " &strTo) WriteHTML("Cc: " &strCc) WriteHTML("Bcc: " &strBcc) WriteHTML("Subject: " &strSubject) WriteHTML("Importance: "&lngImportance) WriteHTML("MailFormat: "&lngMailFormat) WriteHTML("Body: " &strBody) 'WriteHTML("AttachFile "c:\boot.ini") 'if will be attaching a file remove comment at beginning and give the path and filename %> <% ' Next, the CDONTS object is instantiated with the Server.CreateObject method: Set objMsg = Server.CreateObject _ ("CDONTS.NewMail") ' Now that an instance of the object exists and the object's properties are set, ' the message is sent using the send method: objMsg.Send ' Alternative way to send message: ' Set objMsg = Server.CreateObject ' =>("CDONTS.NewMail") ' objMsg.Send strFrom, strTo, strSubject, ' =>strBody, lngImportance Set objMsg = nothing 'release objMsg %> <% Dim strConnect strConnect="provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\Allegro\allegro.mdb" %>

To select to send all e-mails in your data base as displayed in the table please click on OK

<% Dim objConn, objRS, strQuery, strTo 'reading from a DB done via putting it in string and reserving it to a var Set objConn = CreateObject("ADODB.Connection") 'create refs Set objRS = CreateObject("ADODB.Recordset") strQuery = " SELECT Email FROM clients WHERE Email Is Not Null " objConn.Open strConnect 'open can be opened one thing at a time or passed as below objRS.Open strQuery, objConn, adOpenStatic, adLockPessimistic Do While Not objRs.EOF strTo = objRS("Email") Response.Write "" & _ "" objRS.MoveNext Loop ' turn to string objRS.MoveFirst strTo = "" Do While Not objRs.EOF 'returns obj ref as string strTo = strTo & (objRS("Email")) & ";" objRS.MoveNext Loop ' Response.write strTo ' write string emails to hidden fields Response.Write "" '"" & _ '"" & _ '"" Response.Write "

" objRS.Close objConn.Close Set objRs = Nothing Set objConn = Nothing %>
E-mailing List
All Emails in the Data Base:
" & strTo & "

To filter the e-mails by the fields displayed in the table below and view the results please click on Filter


Filtered E-mailing List
Email Sex Client Active Wants E-mail Post Code Age Category Category Description


<% Dim objConn, objRS, strQuery, strTo 'reading from a DB done via putting it in string and reserving it to a var Set objConn = CreateObject("ADODB.Connection") 'create refs Set objRS = CreateObject("ADODB.Recordset") strQuery = "SELECT Email, WantsEmail, ClientActive, PostCode, Sex, clients.AgeCategoryID, age_categories.AgeCategory " & _ " FROM clients, age_categories " & _ " WHERE Email Is Not Null AND WantsEmail=True AND ClientActive=True " & _ " AND PostCode BETWEEN ""J"" AND ""M""" & _ " AND clients.AgeCategoryID=age_categories.AgeCategoryID " objConn.Open strConnect 'open database connection: can be opened one thing at a time or passed as below objRS.Open strQuery, objConn, adOpenStatic, adLockPessimistic Do While Not objRs.EOF strTo = objRS("Email") Response.Write "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" objRS.MoveNext Loop ' turn to string objRS.MoveFirst strTo = "" Do While Not objRs.EOF 'returns obj ref as string strTo = strTo & (objRS("Email")) & ";" objRS.MoveNext Loop ' Response.write strTo ' write string emails to hidden fields Response.Write "" '"" & _ '"" & _ '"" Response.Write "

If You Want To Send" Response.Write " the E-Mails From This List Please Click on OK.
" Response.Write "

" objRS.Close objConn.Close Set objRs = Nothing 'clean up Set objConn = Nothing %>
E-mailing List To Be Sent:
Emails Sex Client Active Wants E-mail Post Code Age Category Category Description
" & strTo & "" & objRS("Sex") & "" & objRS("ClientActive") & "" & objRS("WantsEmail") & "" & objRS("PostCode") & "" & objRS("AgeCategoryID") & "" & objRS("AgeCategory") & "

If You Want To Go BackPlease click on Edit.


The codes are linked to Allegro.mdb where I use two tables for Data Base sources to write the SQL statements and make the inner joint:
table: clients with fields: Email (used as primary key), PostCode, Sex, AgeCategory, WantsEmail, ClientActive
table: age_categories with fields: CategoryID, CategoryDescription
PLEASE NOTE: I am not including the all table fields, as they are not utilized in the email system

Site finalized on 23 March 2001

That's it! There are more filters in cboBoxes, which I am not including in this sample

HOME

Copyright©1999-2007, Vesela Maleeva. All rights reserved. Please ask permission before you print anything.
vmaleeva@hotmail.com