Ciao.

Vorrei inviare un msg email con allegato ad una lista di email contenute in un db.

Le email totali sono 70 e vorrei per alleggerire l'impegno delle risorse del server, inviare 15 email per volta.

Il codice è questo, ma invece di mandare il msg a tutta la lista lo ricevono solo in quattro, dove l'errore?

codice:
   xSQL = " SELECT * FROM "
   xSQL = xSQL & " tbl_users "
   xSQL = xSQL & " ORDER BY "
   xSQL = xSQL & " Email ASC "
   
   Set rec = server.CreateObject("ADODB.Recordset") 
   rec.Open xSQL, Cn

   if not rec.eof then 

   rec.MoveFirst()   
   Conta = 0
   BCC = ""

   Do Until rec.eof
   Do Until (Conta > 15) OR (rec.eof = true)

   BCC = BCC & rec("email") & "; "
   Conta = Conta + 1

  rec.MoveNext() 
  Loop   

'#### CREO LA MAIL ####

Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

With Fields
	.Item(cdoSendUsingMethod)       = cdoSendUsingPort
	.Item(cdoSMTPServer)            = "XXXXXXXXX"
	.Item(cdoSMTPServerPort)        = 25
	.Item(cdoSMTPConnectionTimeout) = 10
	.Update
End With

Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig

With objMessage
    .From     = "MiaMail@xxxx.it"
    .To       = BCC
    .Cc       = "MiaMail@xxxx.it"
    .Subject  = "Messaggio automatico"
    .AddAttachment rec("path")
    .Send
End With

response.write "email inviata a " 
response.write rec("email")
response.write "
"

Conta = 0
BCC = ""

   Set Fields = Nothing
   Set objMessage = Nothing
   Set objConfig = Nothing  
      
   rec.MoveNext()
   Loop 
  
end if