Click to See Complete Forum and Search --> : send email to selected users in DB


dizzyfunk
09-14-2003, 06:09 PM
i want to be able to search a database of users on a variety of criteria, then send an email (using cdonts or jmail) to only the users that the search brought back.

PLEASE NOTE - i don't need to know how to send mail - i can do that!!

i want to see the search results displayed on a page first so i can look at it.. that i can do... i then want a button on the results page that will send the email to all users on that page...

eg... i will search the DB for all surname of 'smith' then send them an email. next i will search for surname 'johnson' AND city of 'london' and then send them an email...

you see, the search criteria can vary each time.

rdoekes
09-15-2003, 02:50 AM
two key things:
1. Dynamic SQL
2. Retrieve recordset and send each member of the recordset an email (to...)

ad 1:
make 2 fields: one field with the field you would like to query, and another with the query value
like: <select name="field"><option value="city">city</option>
<option value="surname">surname</option></select
<input type="text" name="search">

your SQL statement will be:
strSQL = "SELECT email from customers WHERE " & _
Request.Form("field") & " = '" & _
REquest.Form("surname") & "'"

this will grab the list

ad 2: you know how to do this.

-Rogier Doekes

zachzach
09-15-2003, 03:53 PM
that should work i think...