ciao ho questa pagina asp che dovrebbe inviare la newsletter agli utenti regitrati, Quando però la invio mi dà questo errore:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
la cartella che contiene il db ha i permessi di lettura e scrittura. Se nel campo
<form method="POST" action="Gestione_Newsletter.asp?tipo=invia"> tolgo ?tipo=invia non mi restituisce l'errore di prima ma non invia la newsletter. Potete aiutarmi? Posto il codice della pagina:
<% Session.Timeout = 120 %>
<%
' CONTROLLA SE SI E' IDENTIFICATI
IF session("amministratore")<>true then
Response.Redirect "index.asp"
End IF
%>
<html>
<head>
<title>GESTIONE NEWSLETTER</title>
</head>
<body>
<font size="4" face="Verdana">> Invia newsletter!</font></p>
<%
' LEGGE QUELLO CHE DEVE FARE
operazione = Request.QueryString("tipo")
' PERCORSO DEL DATABASE
url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/database/database.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open url_DB
' OPERAZIONE = INVIA IL MESSAGGIO DI NEWSLETTER
IF operazione = "invia" then
' VERIFICA CHE I CAMPI SIANO STATI COMPILATI
IF Request("oggetto") <> "" and Request("testo") <> "" then
' APRE LA CONNESSIONE AL DATABASE E PRELEVA LE EMAIL DELLA NEWSLETTER
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Email_Newsletter"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
IF not RecSet.Eof then
' INDIRIZZO EMAIL NOSTRO
mittente = "miamail@tttt.it"
Do until Recset.eof
' PRELEVA L'EMAIL DELL'UTENTE DAL NOSTRO DATABASE
destinatario = RecSet("email")
' PRELEVA IL TESTO DEL MESSAGGIO DA INVIARE
testo = Request.Form("testo")
' PRELEVA L'OGGETTO DEL MESSAGGIO DA INVIARE
oggetto = Request.Form("oggetto")
' INVIA IL MESSAGGIO
Set objNewMail = CreateObject("CDO.Message")
objNewMail.Subject = oggetto
objNewMail.From = mittente
objNewMail.To = destinatario
objNewMail.HTMLBody = testo
' objNewMail.TextBody = "Kontakt: "&cName&" "&cVorname&vbCrLf&"Email: "&cEmail&vbCrLf&"Datum: "&theDate&vbCrLf&vbCrLf&cComments
' with objNewMail.Configuration
' .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
' .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail." & replace(request.servervariables("SERVER_NAME"), "www.", "", 1, -1, 1)
' .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25"
' .Fields.Update
' end with
objNewMail.Send
' PASSA AVANTI...
RecSet.Movenext
loop
End If
' VISUALIZZA UN MESSAGGIO DI CONFERMA:
%>
<hr>
<p align="center"><font face="Verdana" size="4">Messaggio inviati
correttamente!</font></p>
<hr>
<%
Else
%>
<hr>
<p align="center"><font face="Verdana" size="4">Compila tutti i campi!</font></p>
<hr>
<%
End IF
Else
%>
<form method="POST" action="Gestione_Newsletter.asp?tipo=invia">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="26%"><font face="Verdana" size="2">Oggetto messaggio:</font></td>
<td width="74%"><font face="Verdana" size="2"><input type="text" name="oggetto" size="20"></font></td>
</tr>
<tr>
<td width="26%"><font face="Verdana" size="2">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="Verdana" size="2">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="Verdana" size="2">Numero iscritti:</font></td>
<%
' CONTA GLI ISCRITTI ALLA NEWSLETTER
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT Count(*) FROM Email_Newsletter"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
' CONTA GLI ISCRITTI
IF not RecSet.Eof then
Iscritti = RecSet(0)
Else
Iscritti = 0
End if
%>
<td width="74%"><font face="Verdana" size="2"><%=Iscritti%></font></td>
<%
RecSet.Close
%>
</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>
<%
End IF
Conn.Close
Set Conn = Nothing
Set RecSet = Nothing
%>
</body>
</html>