public ActionResult Add(string uid, string mail, string actualname, string idcard, string age) { if (Session["cheak1"].ToString() == "1") { Session["cheak1"] = "0"; string YZM = YZMHelper.GetRandomString(); Session["uid_1"] = uid; Session["YZM"] = YZM; Session["mail"] = mail.Trim(); Session["actualname"] = actualname; Session["idcard"] = idcard; Session["age"] = age; bool end1 = YiMailHelper.Mail_Uid_exist(uid, Session["mail"].ToString()); if (end1) { if (YiMailHelper.Mail(mail, Session["YZM"].ToString())) { return(View()); } else { return(Content("<script>alert('请输入正确的邮箱');window.location.href='../question/Index';</script>")); } } else { return(Content("<script>alert('你输入的用户名或者邮箱已经被使用');window.location.href='../question/Index';</script>")); } } else { return(View()); } }
public IActionResult Processing_mail(string mymail, string user) { if (!_userInfoRepository.MailUserExist(mymail, user)) { string mailCode = YiMailHelper.GetRandomString(); HttpContext.Session.SetString("MailCode", mailCode); YiMailHelper.Mail(mymail, mailCode); return(Content("OK")); } else { return(Content("NO")); } }