Example #1
0
        public void OnPost()
        {
            //TODO: Server-side validation

            if (ReCaptcha.IsValid(Request.Form["reCaptchaToken"], HttpContext) == false)
            {
                return;
            }
            StringBuilder sb = new StringBuilder();

            foreach (string key in Request.Form.Keys)
            {
                if (key == "__RequestVerificationToken" || key == "reCaptchaToken")
                {
                    continue;
                }
                sb.Append("{ \"" + key + "\":\"" + Request.Form[key] + "\" },");
            }
            Email.Send(
                Request.Form["email"],
                "*****@*****.**",
                "Job application",
                "[" + sb.ToString()[..^ 1] + "]");