i'm assuming you're using a CDONTS object, so i'll use that code
<%
Dim objEmail
Set objEmail = Server.CreateObject("CDONTS.NewMail")
objEmail.From = "Your Name<your@email.com>"
objEmail.To = GetToList
objEmail.Subject = "email"
objEmail.BodyFormat = 0
objEmail.MailFormat = 0
objEmail.body = Request.Form("textareaname")
objEmail.Send
%>
That should work for you
Now as for your loop, i would do something like this, name all your check boxes something like name1, name2, name3 and so on, and your e-mails in some hidden fields called email1, email2, email3, and so on then you can do this,
<%
'------------------
'This function'll create your send list
Function GetToList()
Dim i
Dim strsendmail
Dim stremail
For i = 1 to X 'x is the number of check boxes you have
strsendmail = "name" & i
stremail = "email" & i
Name = GetName(strsendmail)
Email = GetEmail(stremail)
If Name Then
sender = sender & Email & ";"
End If
Next
Set GetToList = sender
%>
<%
'Next you'll need a couple functions for gatherine stuff from your forms
'---------------------
Function Getname(fieldname) 'this function checks to see if an e-mail should be sent
dim blnSend
If Request.Form(fieldname) = "Y" Then
blnSend = True
Else
blnSend = Fale
End If
Set Getname = blnSend
End Function
'----------------------
Function GetEmail(emailname) 'this function gets the person's e-mail
Set GetMail = Request.Form(emailname)
End Function
%>
I'm pretty sure you can do your loop like that, but i can't remember if the request object'll work like that, someone please correct it if i'm wrong, but i do know the setting up e-mail object'll work for you the way i've coded it.
Edited by - Id on 20 July 2001 21:20:53
Edited by - Id on 20 July 2001 21:24:12
Edited by - Id on 20 July 2001 21:33:48
Edited by - Id on 21 July 2001 11:41:31