protected void btnSubmit_Click(object sender, EventArgs e) { string strNewPassword = ""; string strName = ""; string strUserName = ""; string strBCCEmailID = System.Configuration.ConfigurationSettings.AppSettings["AryvartBCCEmailID"].ToString(); string strSystemName = System.Configuration.ConfigurationSettings.AppSettings["AryvartSystemName"].ToString(); try { lstUserDetails = objBL_UserLoginDetails.SelectUserDetailsforForgetPassword(txtEmail.Value.ToString()); if (lstUserDetails.Count > 0) { lblerrormsg.Visible = false; string password = ""; password = lstUserDetails[0].UserPassword; strUserName = lstUserDetails[0].UserName.ToString(); strNewPassword = password; if (lstUserDetails[0].FirstName != null) { strName = lstUserDetails[0].FirstName; } else { strName = strUserName; } string body = MailTemplate.MailHTML(MailTemplate.GetEmailTemplate("ForgotPassword.html").Replace("<systemname>", "Aryvart Email Campaign,").Replace("<receivername>", strName).Replace("<username>", strUserName).Replace("<password>", strNewPassword)); fnSendMail(body); body = ""; lstUserDetails = null; txtEmail.Value = string.Empty; //ClientScript.RegisterStartupScript(Page.GetType(), "mykey12", "javascript:alert('Please check your email for login details.');", true); lblerrormsg.Visible = true; lblerrormsg.Text = "<span style='color:#c85305'>Please check your email for login details.</span>."; } else { lblerrormsg.Visible = true; lblerrormsg.Text = "<span style='color:#c85305'>Email id doesn't exists! Please try another</span>"; } } catch (Exception ex) { New_EmailCampaign.App_Code.GlobalFunction.StoreLog("ForgotPassword.aspx:btnSubmit_Click() - " + ex.Message); } }