Visualizzazione dei risultati da 1 a 2 su 2

Discussione: NEWSLETTER

  1. #1

    Newsletter

    Ciao a tutti. La gestione di questo file ASP mi da questo errore:

    Oggetto server error 'ASP 0177 : 800401f3'

    Impossibile eseguire il metodo Server.CreateObject

    /Gestione_Newsletter.asp, line 15

    Il file in questione è il seguente :

    <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
    Set Conn = Server.CreateObject("ADODB.Commection")
    Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + Server.MapPath("DBASE/DATABASE.Mdb")

    ' 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 EMail FROM Tabella"
    RecSet.Open SQL, Conn, adopenstatic, adlockOptimistic


    IF not RecSet.Eof then

    ' INDIRIZZO EMAIL MITTENTE
    mittente = "info@mdcf.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 email = CreateObject("CDONTS.NewMail")
    email.From = mittente
    email.To = destinatario
    email.Subject = oggetto

    ' FORMATO EMAIL
    email.BodyFormat = Request.Form("formato")
    email.MailFormat = Request.Form("formato")


    email.Body = testo

    ' INVIA L'EMAIL E..
    email.Send

    Set email = nothing

    ' PASSA AVANTI...
    RecSet.Movenext
    loop

    End If

    RecSet.Close
    Conn.close
    Set RecSet = Nothing
    Set Conn = Nothing

    ' 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="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>

    Da cosa potrebbe dipendere. Grazie per l'aiuto. Antonella
    - las penas sirven por asustar a quines no desean cometer pecados -

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    coNNection è con la "N"

    codice:
    Set Conn = Server.CreateObject("ADODB.Connection")
    Roby

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.