Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > how to send ASP newsletter to a select group from Access DB

Thread Tools

how to send ASP newsletter to a select group from Access DB

Posts: n/a
i have an *access database + ASP newsletter* that is working fine and
it sends newsletter to ALL the email addresses in the DB.
i want to send this newsletter to only a select group (like people
with same name or same city etc). how do i do that?
here is the code of newsletter. where should i make changes?
Thanx in advance for ur help.

' Declaring variables
Dim Subject,message,email,data_source,sql_select,no
no = 0
subject = Request.Form("subject") ' title of the newsletter
message = Request.Form("message") ' message of the newsletter

sql_select = "select email from database"
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _


' Check to see if you have not pressed the 'send' button mistakenly
If Len(message) Then

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql_select, data_source
While Not rs.EOF
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.From = "(E-Mail Removed)"
mail.To = rs("email")
mail.Subject = subject
mail.Body = message
Set mail = Nothing
no = no + 1
' When messages have been sent to all the users, exit
Response.Write "Thanks. Newsletter has been sent "

Set rs = Nothing
' Had you pressed the button mistakenly with text area empty, then
' redirect back to the HTML Form
Response.Redirect "newsletter.asp"
End If

i will be adding the following parameters for the selective

firnm = request.form("firstn") ' first name from the form
minm = request.form("midn") ' middle name from the form
lanm = request.form("lastn") ' last name from the form
joined = Request.form("batch") ' year from the form
sender = Request.form("email") ' email add of the person sending the
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Legal for a web forum to send newsletter w/o giving an option to optout? Doc Computer Support 19 11-15-2009 06:04 PM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
Mailer, Newsletter script in asp/ =?Utf-8?B?Sm9l?= ASP .Net 1 02-23-2005 10:33 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM