public void BtnConfirm_Click(object sender, EventArgs e) { string mail = txtEmail.Text.ToString().Trim(); string name = GetLoginNameByEmail(); if (name.Trim().Length > 0) { try { //发送用户名 RegisterMail mailB = new RegisterMail(); string url = mailB.GetEmailSucceedTemplateUrl(); string domain = "http://" + Request.ServerVariables["SERVER_NAME"].ToString(); string validurl = domain + Request.RawUrl.Replace("ErrorEmail.aspx", "RetrieveStep3.aspx"); mailB.SendSucceedMail(Server.MapPath(url), name, mail, domain); Response.Redirect("succeedByemail02.aspx?Email=" + mail + ""); } catch (Exception ex) { Response.Write("<script>alert('请重试!" + ex.Message + "'); </script>"); } } else { this.LblMessage.Text = "如果您忘记了注册时提交的邮箱地址,我们将无法帮助你找回用户名!"; } }
public void BtnConfirm_Click(object sender, EventArgs e) { string mail = txtEmail.Text.ToString().Trim(); string name = GetLoginNameByEmail(); if (name.Trim().Length > 0) { try { RegisterMail mailB = new RegisterMail(); //防止刷新而导致邮件重发 //string CheckUp = mailB.GetCookies("SUCCESS" + name); //if (CheckUp == "" || CheckUp == string.Empty) //{ string url = mailB.GetEmailSucceedTemplateUrl(); string domain = "http://" + Request.ServerVariables["SERVER_NAME"].ToString(); string validurl = domain + Request.RawUrl.Replace("RetrieveStep10.aspx", "RetrieveStep3.aspx"); mailB.SendSucceedMail(Server.MapPath(url), name, mail, domain); //mailB.CreateCookies("SUCCESS" + name, mail, ""); Response.Redirect("succeedByemail02.aspx?Email=" + mail + ""); //} //else //{ // this.LblMessage.Text="用户名成功发送到您的邮箱,请查收"; //} } catch (Exception ex) { Response.Write("<script>alert('请重试!" + ex.Message + "'); </script>"); } } else { Response.Redirect("ErrorEmail.aspx?Email=" + mail + ""); } }