protected void btnsubmit_Click(object sender, EventArgs e) { string _from = "*****@*****.**"; string _to = txtEmail.Text.Trim(); string _subject = "Password Recovery"; string _body = "Hello,"; ds = loginDA.FetchEmailID(_to); if (ds != null && ds.Tables[0].Rows.Count > 0) { string emailaddress = ds.Tables[0].Rows[0]["RECOVERY_EMAIL"].ToString(); string passwordfetch = ds.Tables[0].Rows[0]["PASSWORD"].ToString(); _body = _body + "<br/<br/>Your password is " + passwordfetch + ".<br/><br/<br/><br/>Thanks."; SubmitMailMessage(_from, emailaddress, _subject, _body, true); lblMessage.Text = "Password sent to your email address."; } else { lblMessage.Text = "Username not found in database"; } }