Hi there,

I have a page that grabs 500+ members from a SQL database and send each member
an email. the problem Im having is that it is sending multiple emails to
the recipients. Would this be a problem with CDONTS? Does anybody know of
any bugs that would produce this result?

Ill post the code here:

strAll = ""

Set upl = Server.CreateObject("SoftArtisans.FileUp")

upl.Path = newsattdir

If upl.Form("FILE1").IsEmpty Then
filname = ""
Else
on error resume next
upl.Form("FILE1").Save
If Err <> 0 Then
filname = ""
Else
filname = Mid(upl.UserFilename, InstrRev(upl.UserFilename, "\") + 1)
End If
End If

set conn = server.createobject("adodb.connection")
conn.open dbpath

set rs = server.createobject("adodb.recordset")

rs.ActiveConnection = conn
rs.CursorType = adOpenStatic
strSQL = "SELECT MEMBER_EMAIL FROM MEMBER WHERE (NEWSLETTER = 1) AND (ACTIVE
= 1)"
rs.open strSQL

if not (rs.EOF and rs.BOF) then
Do while not rs.EOF
strAll = strAll & rs("MEMBER_EMAIL") & ";"
rs.movenext
Loop
end if

If Right(strAll,1) = ";" Then
strAll = Left(strAll, Len(strAll)-1)
End If

rs.close
set rs = nothing
conn.close
set conn = nothing

strTitle = "GENERIC NEWSLETTER"
strMsg = "Mail sent to all members who agreed to receive newsletter !"
strFrom = strAdmail
strTo = strAdmail
strSubject = upl.Form("subject")
strBody = upl.Form("body") & vbCrLf & vbCrLf

Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

objCDOMail.From = strFrom
objCDOMail.To = "members@efixit.com.au"
objCDOMail.Bcc = strAll
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody

if (Len(filname) > 0) then
objCDOMail.AttachFile upl.Form("FILE1"), filname
end if

objCDOMail.Send

Set objCDOMail = Nothing


Any help would be greatly appreciated!

Thanks - Matt