codice:
<%
IF session("amministratore")<>true then
Response.Redirect "index.asp"
End IF
%>
<html>
<head>
<title>GESTIONE NEWSLETTER</title>
</head>
<body background="../../sfondo3.JPG">
<font size="4" face="Verdana">> Invia newsletter!</font></p>
<%
operazione = Request.QueryString("tipo")
url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/database.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open url_DB
If operazione = "invia" then
If Request("oggetto") <> "" and Request("testo") <> "" then
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Email_Newsletter"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
If not RecSet.Eof then
mittente = "webmaster@leocapodorlando.eu"
Do until Recset.eof
destinatario = RecSet("email")
testo = Request.Form("testo")
oggetto = Request.Form("oggetto")
Set email = CreateObject("CDONTS.NewMail")
email.From = mittente
email.To = destinatario
email.Subject = oggetto
email.BodyFormat = Request.Form("formato")
email.MailFormat = Request.Form("formato")
email.Body = testo
email.Send
Set email = nothing
RecSet.Movenext
Loop
End If
RecSet.Close
Conn.close
Set RecSet = Nothing
Set Conn = Nothing
%>
<hr>
<p align="center"><font face="Verdana" size="4">Messaggio inviato correttamente!</font></p>
<p align="center">
[img]../../logoleo2.gif[/img]</p>
<hr>
<%
Else
%>
<hr>
<p align="center"><font face="Verdana" size="4">Compila tutti i campi!</font></p>
<p align="center">
[img]../../logoleo2.gif[/img]</p>
<hr>
<font face=Verdana" color=#0000FF size=5>
<p align="center">Creazione E-mail
[img]../../logoleo2.gif[/img]</font></p>
<form method="POST" action="Gestione_Newsletter.asp?tipo=invia">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Oggetto messaggio:</font></td>
<td width="74%"><font face="Verdana" size="2">
<input type="text" name="oggetto" size="34"></font></td>
</tr>
<tr>
<td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Testo messaggio:</font></td>
<td width="74%"><font face="Verdana" size="2"><textarea rows="6" name="testo" cols="67"></textarea></font></td>
</tr>
<tr>
<td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Formato e-mail:</font></td>
<td width="74%"><select size="1" name="formato">
<option selected value="1">Testo</option>
<option value="0">HTML</option>
</select></td>
</tr>
<tr>
<td width="26%"><font face="Times New Roman" size="4" color="#0000FF">Numero iscritti:</font></td>
<%
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT Count(*) FROM Email_Newsletter"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
IF not RecSet.Eof then
Iscritti = RecSet(0)
Else
Iscritti = 0
End if
%>
<td width="74%"><font face="Verdana" size="2"><%=Iscritti%></font></td>
<%
IF RecSet.Close then
End if
%>
</tr>
<tr>
<td width="100%" colspan="2"><input type="submit" value="Invia Newsletter!" name="B1"><input type="reset" value="Reimposta" name="B2"></td>
</tr>
</table>
</form>
</p>
<%
IF Conn.Close then
Set Conn = Nothing
Set RecSet = Nothing
End IF
%>
Gli if grassettati non hanno end if, come del resto ti indicava il debugger. Sta a te metterli dove vuoi in base a quello che devi fare...