예제 #1
0
        public IActionResult GetPassWord_Email()
        {
            B_MailManage mailBll = new B_MailManage();

            if (!VerifyHelper.Check(RequestEx["VCode_Hid"]))
            {
                return(WriteErr("验证码不正确", "/User/GetPassword"));
            }
            M_UserInfo mu = GetUserByName(RequestEx["TxtUserName"]);

            if (string.IsNullOrEmpty(mu.Email) || mu.Email.Contains("@random"))
            {
                return(WriteErr("用户未设置邮箱,无法通过邮箱找回"));
            }
            //生成Email验证链接
            string seturl = function.GetRandomString(12) + "," + DateTime.Now.ToString();

            mu.seturl = EncryptHelper.AESEncrypt(seturl);
            buser.UpDateUser(mu);
            //Email发送
            string url       = SiteConfig.SiteInfo.SiteUrl + "/User/Change/GetPassWord?key=" + mu.seturl + "&uid=" + mu.UserID;
            string returnurl = "<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>";
            string content   = mailBll.SelByType(B_MailManage.MailType.RetrievePWD);

            content = new OrderCommon().TlpDeal(content, GetPwdEmailDt(mu.UserName, SiteConfig.SiteInfo.SiteName, returnurl));
            MailInfo mailInfo = SendMail.GetMailInfo(mu.Email, SiteConfig.SiteInfo.SiteName, SiteConfig.SiteInfo.SiteName + "_找回密码", content);

            SendMail.Send(mailInfo);
            //不需要更新步骤,其从邮箱进入地址栏后再更新
            string emailUrl = B_Plat_Common.GetMailSite(mu.Email);

            return(WriteOK("密码重设请求提交成功,<a href='" + emailUrl + "' target='_blank'>请前往邮箱查收</a>!!"));
        }
예제 #2
0
        public void GetPassWord_Email()
        {
            B_MailManage mailBll = new B_MailManage();

            if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["VCode_hid"], Request.Form["VCode"]))
            {
                function.WriteErrMsg("验证码不正确", "/User/GetPassword"); return;
            }
            M_UserInfo mu = GetUserByName(Request.Form["TxtUserName"]);

            if (string.IsNullOrEmpty(mu.Email) || mu.Email.Contains("@random"))
            {
                function.WriteErrMsg("用户未设置邮箱,无法通过邮箱找回"); return;
            }
            //生成Email验证链接
            string seturl = function.GetRandomString(12) + "," + DateTime.Now.ToString();

            mu.seturl = seturl;
            buser.UpDateUser(mu);
            //Email发送
            string url       = SiteConfig.SiteInfo.SiteUrl + "/User/GetPassWord?key=" + mu.seturl + "&uid=" + mu.UserID;
            string returnurl = "<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>";
            string content   = mailBll.SelByType(B_MailManage.MailType.RetrievePWD);

            content = new OrderCommon().TlpDeal(content, GetPwdEmailDt(mu.UserName, SiteConfig.SiteInfo.SiteName, returnurl));
            MailInfo mailInfo = SendMail.GetMailInfo(mu.Email, SiteConfig.SiteInfo.SiteName, SiteConfig.SiteInfo.SiteName + "_找回密码", content);

            SendMail.Send(mailInfo);
            //不需要更新步骤,其从邮箱进入地址栏后再更新
            function.WriteSuccessMsg("密码重设请求提交成功,<a href='" + B_Plat_Common.GetMailSite(mu.Email) + "' target='_blank'>请前往邮箱查收</a>!!", "", 0); return;
        }
예제 #3
0
        public IActionResult Email_SendEmail()
        {
            CheckNum = function.GetRandomString(8).ToLower();
            string   mailcontent = "您好,您正在<a href='" + SiteConfig.SiteInfo.SiteUrl + "'>" + SiteConfig.SiteInfo.SiteName + "</a>网站修改邮箱,您本次的验证码为:" + CheckNum;
            MailInfo mailInfo    = SendMail.GetMailInfo(mu.Email, SiteConfig.SiteInfo.SiteName, "修改邮箱[" + SiteConfig.SiteInfo.SiteName + "]", mailcontent);

            SendMail.Send(mailInfo);
            ShowMsg("注册验证码已成功发送到你的注册邮箱,<a href='" + B_Plat_Common.GetMailSite(mu.Email) + "' target='_blank'>请前往邮箱查收并验证</a>!", "info");
            ViewBag.email = mu.Email;
            return(View("Email"));
        }
예제 #4
0
    //发送验证邮件
    protected void SendEMail_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo mu = buser.GetLogin();

        CheckNum = function.GetRandomString(8).ToLower();
        //-------------------------------------
        //string regurl = SiteConfig.SiteInfo.SiteUrl.TrimEnd('/') + "/User/ChangeEmail.aspx?CheckNum=" + code;
        string   mailcontent = "您好,您正在<a href='" + SiteConfig.SiteInfo.SiteUrl + "'>" + SiteConfig.SiteInfo.SiteName + "</a>网站修改邮箱,您本次的验证码为:" + CheckNum;
        MailInfo mailInfo    = SendMail.GetMailInfo(mu.Email, SiteConfig.SiteInfo.SiteName, "修改邮箱[" + SiteConfig.SiteInfo.SiteName + "]", mailcontent);

        SendMail.Send(mailInfo);
        ShowInfo("注册验证码已成功发送到你的注册邮箱,<a href='" + B_Plat_Common.GetMailSite(mu.Email) + "' target='_blank'>请前往邮箱查收并验证</a>!");
    }
예제 #5
0
    //-----------------Step2
    protected void SendNewEmail_Btn_Click(object sender, EventArgs e)
    {
        NewEmail = NewEmail_T.Text.Trim();
        if (buser.IsExistMail(NewEmail))
        {
            ShowAlert("该邮箱已存在"); NewEmail = ""; return;
        }
        NewCheckNum = function.GetRandomString(8).ToLower();
        string   mailcontent = "您好,您正在<a href='" + SiteConfig.SiteInfo.SiteUrl + "'>" + SiteConfig.SiteInfo.SiteName + "</a>网站修改邮箱,您本次的验证码为:" + NewCheckNum;
        MailInfo mailInfo    = SendMail.GetMailInfo(NewEmail, SiteConfig.SiteInfo.SiteName, "修改邮箱[" + SiteConfig.SiteInfo.SiteName + "]", mailcontent);

        SendMail.Send(mailInfo);
        ShowInfo("注册验证码已成功发送到你的注册邮箱,<a href='" + B_Plat_Common.GetMailSite(NewEmail) + "' target='_blank'>请前往邮箱查收并验证</a>!");
    }
예제 #6
0
        public ActionResult Email_SendNewEmail()
        {
            string newEmail = Request["newemail"];

            ViewBag.newemail = newEmail;
            Step             = 2;
            if (buser.IsExistMail(newEmail))
            {
                ShowMsg("该邮箱已存在", "danger"); return(View("Email"));
            }
            NewCheckNum = function.GetRandomString(8).ToLower();
            string   mailcontent = "您好,您正在<a href='" + SiteConfig.SiteInfo.SiteUrl + "'>" + SiteConfig.SiteInfo.SiteName + "</a>网站修改邮箱,您本次的验证码为:" + NewCheckNum;
            MailInfo mailInfo    = SendMail.GetMailInfo(newEmail, SiteConfig.SiteInfo.SiteName, "修改邮箱[" + SiteConfig.SiteInfo.SiteName + "]", mailcontent);

            SendMail.Send(mailInfo);
            ShowMsg("注册验证码已成功发送到你的注册邮箱,<a href='" + B_Plat_Common.GetMailSite(newEmail) + "' target='_blank'>请前往邮箱查收并验证</a>!", "info");
            return(View("Email"));
        }