Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    script recupero password con CDONTS.NewMail

    Ciao,
    ho un problema con questo script per recupero password.
    Tutto ok per quanto riguarda il controllo nel database, dell'esistenza dell'email a cui inviare la password, ma se l'emailè presente da errore Http 500 errore interno ....

    Mi potete aiutare?
    Grazie



    <%Response.Buffer=TRUE%>
    <%
    'here is the connection string
    Set conn = server.createobject("adodb.connection")
    'this connection uses JET 4 it is the prefered method of connecting to an access database
    DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath(".../login.mdb")
    'if you cant use JET then comment out the line above and uncomment the line below
    'DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath(".../login.mdb")
    conn.Open DSNtemp

    'here we are getting the info from the lost password form
    uid = Request.Form("T1")

    SQL = "Select * From users Where uid = '" & uid & "'"
    Set RS = Conn.Execute(SQL)

    'HERE WE CHECK TO MAKE SURE THE USERS EMAIL EXISTS, IF IT DOES, WE EMAIL IT
    If NOT RS.EOF Then

    Dim mytxt
    'HERE YOU CAN ASSIGN ANY TEXT YOU LIKE TO GO IN THE EMAIL WITH THE PASSWORD, LEAVE IT IN THE QUOTES!!!
    mytxt = "Here is your password:"

    Dim ObjMail
    Set ObjMail = Server.CreateObject("CDONTS.NewMail")
    ' if the email address exists then the info is sent here
    ObjMail.To = RS("uid")
    '############################### CHANGE THE EMAIL BELOW TO YOUR ADMIN EMAIL
    '############################### leave it in the quotes!!!!!
    Objmail.From = "mia_email"
    ObjMail.Subject = "Lost Password"
    'HERE IS THE BODY SENDING PASSWORD
    ObjMail.Body = mytxt & vbcrlf&_
    RS("pwd")
    ObjMail.Send
    Set ObjMail = Nothing

    x = "Your Password Will Be Sent To The Email Address You Are Registered With"

    Else

    'IF THE EMAIL DOES NOT EXIST WE TELL THE BELOW
    x = "Sorry The Email Address You Entered Does Not Exist"

    End If
    %>
    <html>
    <head>
    <title>Lost Password</title>
    </head>
    <body>
    <center><%=x%></center>
    </body>
    </html>

  2. #2
    Probabilmente il server non usa CDONTS ma CDOSYS.

  3. #3
    Sempre solita solfa, su IE > strumenti > opzioni Internet > avanzate > togli il flag da "mostra messaggi di errore http brevi" fai il reload della pagina e ci dici l'errore specifico che ti viene restituito

  4. #4
    Il sito è su Aruba e in effetti andando a leggere, il CDONTS è stato sostituito da CDOSYS.
    Ma come faccio ad adattarlo alle mie esigenze?

    Seguendo il consiglio di alexba64 l'errore è:

    Server object error 'ASP 0177 : 800401f3'
    Server.CreateObject Failed
    /sent.asp, line 25
    800401f3

    Infatti alla linea 25:

    Set ObjMail = Server.CreateObject("CDONTS.NewMail")

    Posso modificarlo per Aruba?

    Grazie
    Alessandra

  5. #5

  6. #6
    Avevo gia visto, ma sono esempi semplici,
    il mio caso è piu complesso peechè prima deve fare la ricerca nel database e poi inviare l'email con la password che deve crcare sempre nel database.

    Non so come adattarlo.

  7. #7
    Prova così:
    codice:
    <%Response.Buffer=TRUE%>
    <%
    'here is the connection string
    Set conn = server.createobject("adodb.connection")
    'this connection uses JET 4 it is the prefered method of connecting to an access database
    DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath(".../login.mdb")
    'if you cant use JET then comment out the line above and uncomment the line below
    'DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath(".../login.mdb")
    conn.Open DSNtemp
    
    'here we are getting the info from the lost password form
    uid = Request.Form("T1")
    
    SQL = "Select * From users Where uid = '" & uid & "'"
    Set RS = Conn.Execute(SQL)
    
    'HERE WE CHECK TO MAKE SURE THE USERS EMAIL EXISTS, IF IT DOES, WE EMAIL IT
    If NOT RS.EOF Then
    
    Dim mytxt
    'HERE YOU CAN ASSIGN ANY TEXT YOU LIKE TO GO IN THE EMAIL WITH THE PASSWORD, LEAVE IT IN THE QUOTES!!!
    mytxt = "Here is your password:"
    
    Dim ObjMail
    Set ObjMail = Server.CreateObject("CDO.Message")
    ' if the email address exists then the info is sent here
    ObjMail.To = RS("uid")
    '############################### CHANGE THE EMAIL BELOW TO YOUR ADMIN EMAIL
    '############################### leave it in the quotes!!!!!
    Objmail.From = "mia_email"
    ObjMail.Subject = "Lost Password"
    'HERE IS THE BODY SENDING PASSWORD
    ObjMail.TextBody = mytxt & vbcrlf&_
    RS("pwd")
    ObjMail.Send
    Set ObjMail = Nothing
    
    x = "Your Password Will Be Sent To The Email Address You Are Registered With"
    
    Else
    
    'IF THE EMAIL DOES NOT EXIST WE TELL THE BELOW
    x = "Sorry The Email Address You Entered Does Not Exist"
    
    End If
    %>
    <html>
    <head>
    <title>Lost Password</title>
    </head>
    <body>
    <center><%=x%></center>
    </body>
    </html>

  8. #8
    Grazie mille,
    dopo vari tentativi ho risolto.

    Ciao
    Alessandra

  9. #9

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.