public void Submit() { if (Helpers.SessionVariables.Instance.LoggedIn == false) { return; } try { string subject = Helpers.GlobalHelper.RequestEncodedParam("subject"); string message = Helpers.GlobalHelper.RequestEncodedParam("supportrequest"); message = "User Id: " + Helpers.SessionVariables.Instance.UserId + System.Environment.NewLine + "Email: " + Helpers.SessionVariables.Instance.Username + System.Environment.NewLine + System.Environment.NewLine + message; var email = new LibLogic.Email.LiveEmail(); email.SendMail_BackgroundThread(message, subject, "*****@*****.**", false, null, LibLogic.Email.EmailTemplates.None); this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.OK; this.HttpContext.Response.Redirect("/support/thankyou", false); } catch (LibLogic.Exceptions.InvalidDataException ide) { LibLogic.Helpers.Logging.Log(ide); this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest; this.HttpContext.Response.Write(ide.Message); } catch (Exception ex) { LibLogic.Helpers.Logging.Log(ex); this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError; } }
protected void Application_Start(object sender, EventArgs e) { RegisterWebFormRoutes(RouteTable.Routes); RegisterRazorRoutes(RouteTable.Routes); var mySqlInstance = System.Configuration.ConfigurationManager.AppSettings["MySqlInstance"].ToString(); var mySqlDatabase = System.Configuration.ConfigurationManager.AppSettings["MySqlDatabase"].ToString(); var email = new LibLogic.Email.LiveEmail(); var setup = new LibLogic.Setup(mySqlInstance, mySqlDatabase, email, false); try { setup.Execute(); } catch (Exception ex) { LibLogic.Helpers.Logging.Log(ex); email.SendMail_BackgroundThread("It appears the server setup failed: " + ex.Message, "MajorsilnceVPN setup failure on application_start", LibLogic.Helpers.SiteInfo.AdminEmail, false, null); } }