Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Aiuto invio newsletter

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2005
    Messaggi
    14

    Aiuto invio newsletter

    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">&gt; 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>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Occorre che il server ti mostri un errore reale, non un generico messaggio.

    Roby

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2005
    Messaggi
    14
    La sola cosa che mi restituisce il server è quanto riporto sotto:

    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.

    More information about this error may be available in the server error log.


    Niente di più. cosa devo fare?

  4. #4
    Originariamente inviato da titta
    More information about this error may be available in the server error log.
    hai guardato nel log come ti viene detto di fare?

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2005
    Messaggi
    14
    Ho chiesto all'Amministratore e mi ha risposto che entro sera dovrei avere disponibile il log per verificare eventuali errori (che di base non è abilitato) sul dominio.

    Poi se non ti spiace posto l'errore nel caso non riuscissi a sisteare.
    Grazie e buona giornata

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.