Questo è il file che uso per spedire le email è un minestrone perche non l'ho fatto io e lo dovuto adatare al volo (come so fare io) e non sono un genio.codice:<html> <head> <% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_ "DBQ="& Server.MapPath("/mdb-database/newsletter.mdb/") sql = "SELECT * FROM Subscribers WHERE nuova = 1 order by nome" Set Rs = Conn.Execute(sql) Do While not Rs.EOF collegamenti=collegamenti&"<option>"&rs("nome")&"</option>"&" " Rs.MoveNext Loop Rs.Close Set Rs = Nothing Conn.Close Set Conn = Nothing %> </head> <body> <% If Request.Form("cmdSubmit") <> "" Then Set con = GetDBConnection() strSql = "SELECT Email FROM Subscribers WHERE nome ='"&request.form("destinatario")&"'" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open strSql, con, 1, 2 If rs.EOF Then rs.Close() Set rs = Nothing con.Close() Set con = Nothing Response.End End If While Not(rs.EOF) destinatario=rs("Email") testo=testo &Request.Form("txtEmail") oggetto = "La notte dei saldi." Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields Flds(cdoSendUsingMethod) = cdoSendUsingPort Flds(cdoSMTPServer) = "smtp.aruba.it" Flds(cdoSMTPServerPort) = 25 Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0 Flds.Update With iMsg Set .Configuration = iConf .To = destinatario .From = "mitente" .Sender = "mail@aruba.it" .Subject = oggetto .HtmlBody = testo .Send rs.MoveNext() End With Wend rs.Close() Set rs = Nothing con.Close() Set con = Nothing response.redirect"send.asp" Else %> <form action="send.asp" method="post" id=form1 name=form1> <div align="center"> Inserisci il testo da spedire. <textarea name="txtEmail" cols="50" rows="30"></textarea> <select size="1" name="destinatario"> <option value="<%=collegamenti%>"><%=collegamenti%></option> </select><input type="submit" name="cmdSubmit" value="Submit"> </div> </form> <% End If %> </body> </html>
O inviato quasi tutte le email con blocchi di 30 per volta ma ad un certo punto per un blocco di 10 email si blocca e per le altre che spedisco continua a funzionare normalmente. Come mai???![]()

Rispondi quotando