Click here to Skip to main content
16,016,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using vb.net only
can any one send code for: how to send email using PasswordRecovery, verify first in database(myaccess) whether username exists

i have stored user information in database, now how to send password as an email, {if user is true} and the email address is located in database? how to send email


please send me the code
Posted
Updated 8-Apr-10 1:23am
v2

//i got it yaar, updating password in database(myaccess) using password //recovery control

//this in .aspx



<asp:removed id="ChangePassword1" runat="server" style="z-index: 100; left: 16px;<br mode=" hold=" /> position: absolute; top: 176px" passwordlabeltext="old:" changepasswordtitletext="" newpasswordregularexpression="([a-zA-Z0-9]{0,15})" changepasswordfailuretext="" xmlns:asp="#unknown">

  

<asp:removed id="Label1" runat="server" style="z-index: 101; left: 424px; position: absolute;<br mode=" hold=" /> top: 208px" text="" forecolor="red" xmlns:asp="#unknown">
<asp:removed id="TextBox1" runat="server" style="z-index: 100; left: 178px; position: absolute;<br mode=" hold=" /> top: 152px" xmlns:asp="#unknown">
   







                       
   


                       
UserName:

                         



//this in aspx.vb


Imports System.Data
Imports System.Data.OleDb
Imports System.Web.UI.WebControls


Partial Class change_password
Inherits System.Web.UI.Page
Protected Sub Changepassword1_ChangingPassword(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles ChangePassword1.ChangingPassword
Dim Password As String = ChangePassword1.CurrentPassword
Dim NewPassword As String = ChangePassword1.NewPassword
Dim ConfirmNewPassword As String = ChangePassword1.ConfirmNewPassword

'here provide your database and path of datasource
Dim connect As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Bhuvana\Anil\kankatala.mdb;"
Dim conn As New OleDbConnection(connect)
Dim cmd As New OleDbCommand
cmd.Connection = conn
conn.Open()

cmd.CommandText = "select * FROM registered_customers WHERE login_name= '" & TextBox1.Text & "' AND pword='" & Password & "'"
dr = cmd.ExecuteReader()
If dr.Read() Then
'provide again address of database
Dim connect1 As String= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Bhuvana\Anil\kankatala.mdb;"
Dim conn1 As New OleDbConnection(connect1)
Dim cmd1 As New OleDbCommand
cmd1.Connection = conn
conn1.Open()
cmd1.CommandText = "update registered_customers set pword='" & NewPassword & "' where login_name='" & TextBox1.Text & "'"
cmd1.ExecuteNonQuery()
conn1.Close()
Label1.Text = "Password Changed"
Else
Label1.Text = " Invalid UserName/Password "
End If
End Sub


End Class

//thats it ...it is done
 
Share this answer
 
Anil Sarda wrote:
please send me the code


No. We are not here to do your work for you.

This is a very simple task that has been covered by many, many, many resources. What have you done to help yourself?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900