ho questo codice dove scrivo in un db e mando una mail per ogni mio contatto:
per alleggerire il carico di lavore del server è meglio se l'oggetto rs1 lo creo e lo distruggo fuori dal ciclo o è uguale?codice:for xx = 0 to UBound(arr_strStore) strSQL="INSERT INTO tblblocco (store,autore,titolo,testo,data,destinatario,allegato)VALUES ('"& trim(arr_strStore(xx))& "','"&strNome&"','"&strTitolo&"','"&strMessaggio&"','"&strData&"','"&strDestinatario&"','"&strAllegato&"')" objConn.Execute strSQL dim rs1,SQL1, strEmailda,strEmaila,strBody,objMail Set rs1 = Server.CreateObject("ADODB.Recordset") SQL1= "SELECT email FROM mobyle where store = '"& trim(arr_strStore(xx))& "' " rs1.Open SQL1, connUS strEmailda = request.Form("email") strEmaila = rs1("email") strBody = strMessaggio & " Troverai questo messaggio anche negli appunti" 'invio email Set objMail = Server.CreateObject("CDONTS.NewMail") objMail.From = strEmailda objMail.To = strEmaila objMail.Subject = strTitolo objMail.Body = strBody objMail.BodyFormat = 0 objMail.MailFormat = 0 objMail.importance=2 if strAllegato <> "" then objMail.AttachFile Server.MapPath("/dati/public/allegatiemail/"&strAllegato) end if objMail.Send () Set objMail = nothing rs1.close() set rs1=NOTHING next

Rispondi quotando