protected void btnSave_Click(object sender, EventArgs e) { try { //if (Mode == "Insert") //{ InsertDisclaimer(); if (ManageMemberShip.CheckForInternetConnection()) { SendEmail(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_valid", "MessageBox('Error', 'Please Check Youur Internet Connection')", true); } BindGrid(); //} //else // UpdateDisclaimer(); ClearValues(); pnlLeadsDetails.Visible = false; MeasurementPanelVisibility(false, false); updtpnl1.Visible = false; pnlOffice.Visible = false; pnlSave.Visible = false; PanelVisibility(true, false, false); //BindGrid(); } catch (Exception ex) { throw ex; } }
//protected void btnSend_Click(object sender, EventArgs e) //{ // try // { // sub = "Website Contact Form: " + txtName.Text; // msg = "You have received a new message from your website contact form.<br/><br/>"; // msg += "Here are the details:<br/><br/>Name: " + txtName.Text + "<br/><br/>Email: " + txtEmail.Text + // "<br/><br/>Contact: " + txtContact.Text + "<br/><br/>FitnessGoal:" + rdoGoalList.SelectedItem + "<br/><br/>Message:<br/>" + txtMessage.Text; // mail.MailGmail("*****@*****.**", "Newway@123", "*****@*****.**", sub, msg); // lblMsg.Text = "Thank You ! Your email has been delivered."; // script = "$('.mail-message').removeClass('not-visible-message').addClass('visible-message');"; // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", script, true); // } // catch (Exception ex) // { // lblMsg.Text = "Error ! Your Email has not been delivered"; // script = "$('.mail-message').removeClass('not-visible-message').addClass('visible-message');"; // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", script, true); // throw ex; // } //} protected void btnSend_Click1(object sender, EventArgs e) { try { if (ManageMemberShip.CheckForInternetConnection()) { sub = "Website Contact Form: " + txtName.Text; msg = "You have received a new message from your website free trial form.<br/><br/>"; msg += "Here are the details:<br/><br/>Name: " + txtName.Text + "<br/><br/>Email: " + txtEmail.Text + "<br/><br/>Contact: " + txtContact.Text + "<br/><br/>FitnessGoal:" + rdoGoalList.SelectedItem + "<br/><br/>Message:<br/>" + txtMessage.Text; string from = "*****@*****.**"; //example:- [email protected] MailMessage mail = new MailMessage(); mail.From = new MailAddress(from); mail.To.Add(from); mail.Subject = sub; mail.Body = msg; mail.IsBodyHtml = false; SmtpClient smtp = new SmtpClient("intensity.net.in", 587); smtp.EnableSsl = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info@123"); smtp.Send(mail); // ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Message has been sent successfully.');", true); lblMsg.Text = "Thank You ! Your email has been delivered."; script = "$('.mail-message').removeClass('not-visible-message').addClass('visible-message');"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", script, true); //Response.Redirect("./FreeTrialReceipt.aspx?contact=" + txtContact.Text); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_valid", "MessageBox('Error', 'Please Check Youur Internet Connection')", true); } } catch (Exception ex) { lblMsg.Text = "Error ! Your Email has not been delivered"; script = "$('.mail-message').removeClass('not-visible-message').addClass('visible-message');"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", script, true); throw ex; } }
protected void btnSend_Click(object sender, EventArgs e) { if (drpPosition.SelectedIndex == 0) { script = "$('.mail-message').removeClass('not-visible-message').addClass('visible-message');"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_msg", script, true); lblMsg.Text = "Please select Position First"; script = "$('.mail-message').removeClass('alert-success').addClass('alert-danger');"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "dng_msg", script, true); } else if (ManageMemberShip.CheckForInternetConnection()) { SendMessage(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "err_valid", "MessageBox('Error', 'Please Check Youur Internet Connection')", true); } }