Forums

This topic is locked

How to use command in this case? only experts

Posted 01 May 2002 05:22:59
1
has voted
01 May 2002 05:22:59 scre wdanger posted:
Hi,
Before i describe my problem let me tell you frankly, i am not good at codé writing.
Earlier i asked the same question but alas inteligent people were out of town so here we go again.
I have a page that shows all the users along with there mail adresses. I can send them all mails with a click.
What i wanna do is: to add a check box in the repeat region so that one may choose who should receive a mail and who not.
If the checbox is clicked then this particular user will get a mail otherwise he will be excluded.

The code so far that i use to send all mail is:

<
set grid = Server.CreateObject("ADODB.Recordset"
grid.ActiveConnection = MM_connDUforum_STRING
grid.Source = "SELECT M_ID, M_FIRST, M_LAST, M_EMAIL FROM MEMBERS"
grid.CursorType = 0
grid.CursorLocation = 2
grid.LockType = 3
grid.Open()
grid_numRows = 0
%>
<
' connect to the MS Access database in the same directory
strDbPath = Server.MapPath("." & "\******\******.mdb"
ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strDbPath & ";PWD=********"

Set rs = Server.CreateObject("adodb.recordset"
rs.Open "MEMBERS", ConnectStr, 2, 3

If Request("Send" <> "" Then
' send email to all users
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = strHost

Mail.From = "****@****.com"
Mail.FromName = "Webmaster"
Mail.Subject = Request("Subject"
Mail.Body = Request("Body"

' read address from DB and put them in the BCC field
While not rs.EOF
Mail.AddBcc rs("M_EMAIL", rs("M_ID"
rs.MoveNext
Wend

' finally: send message
Mail.Send

Response.Write "e-mail has been succesfully sent!"

End If

%>

so what do i do to use commands and make my dream come true.or else if one knows a good tutorial on how to use commands then that will be great as well.

Regards

Replies

Replied 02 May 2002 00:04:29
02 May 2002 00:04:29 scre wdanger replied:
Well one option i found is to use update command. First to update the list and then send mails.
Still looking for a solution where i can simply do it without update command.
Common hurry

Reply to this topic