Hi, Could anyone provide asp.net code that would generate an automated email containing a users password from a database when they submit there email address. Any good sites on the subject either!
Hi Seán, Use the code below U neew to include the following for using the code below using System.Data.SqlClient,using System.Web.Mail,using System.Data; SqlConnection gSqlConn=new SqlConnection("Your Data Con Str"); SqlDataAdapter da = new SqlDataAdapter("select
emailfrom, emailTo, password from emailTable where email='" + txtEmail.Text + "'", gSqlConn); // txtEmail.Text=email add provided by the user DataSet ds =new DataSet(); da.Fill(ds, "Email"); DataRow dr; dr = ds.Tables["Email"].Rows[0]; MailMessage objMailMessage=new
MailMessage(); objMailMessage.From = dr["emailfrom"].ToString(); objMailMessage.To = dr["emailTo"].ToString(); objMailMessage.Subject = "Password"; objMailMessage.Body = dr["password"].ToString(); SmtpMail.SmtpServer = "localhost" //use whatever is ur smtp
host SmtpMail.Send(objMailMessage); hope this helps --- Rohit
---------------------------------------------------------------------------
Hope this helps, if it does then mark it as answer
Rohit
Seán
Member
35 Points
7 Posts
Automated generated email - for user password
Jul 31, 2003 04:30 PM|LINK
Rohit Kukret...
Participant
1659 Points
318 Posts
Re: Automated generated email - for user password
Aug 01, 2003 12:08 PM|LINK
Hope this helps, if it does then mark it as answer
Rohit
Seán
Member
35 Points
7 Posts
Re: Automated generated email - for user password
Aug 02, 2003 01:21 PM|LINK