private void btnSubmit_ServerClick(object sender,EventArgs e) { BPSetup bp = new BPSetup(); BESetup.tbl_SetupRow category; dsSetup = new BESetup(); // Edit a Product Category dsSetup = bp.SelectAll(); if(SetupID == 0) { category = dsSetup.tbl_Setup.Newtbl_SetupRow(); } else { category = dsSetup.tbl_Setup.FindBySetupID(SetupID); } //all content to be updated/inserted between here category.SetupEmailAddress1 = txtEmail1.Text; category.SetupEmailAddress2 = txtEmail2.Text; category.SetupEmailServer = txtEmailServer.Text; category.DateModified = DateTime.Now; category.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID); //all content to be updated/inserted between here if(SetupID == 0) { category.DateCreated = DateTime.Now; dsSetup.tbl_Setup.Addtbl_SetupRow(category); } bp.Update(dsSetup); Response.Redirect("Index.aspx"); }
private void btnSend_ServerClick(object sender, EventArgs e) { if (txtFrom.Text == string.Empty) { lblErr.Visible = true; lblErr.Text = "Error: Please enter your email address."; } else { BECustomers ds = new BECustomers(); BPCustomers bp = new BPCustomers(); ds = bp.SelectByCustomerEmail(txtFrom.Text); if (ds.tbl_Customers.Count > 0) { BESetup setupInfo = new BESetup(); BPSetup bpSetup = new BPSetup(); setupInfo = bpSetup.SelectAll(); SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer; BECustomers.tbl_CustomersRow customer = ds.tbl_Customers[0]; MailMessage mm = new MailMessage(); mm.To = (txtFrom.Text.Replace(",", ";")).Trim(); mm.From = setupInfo.tbl_Setup[0].SetupEmailAddress1; //mm.Subject = txtSubj.Text; mm.Subject = "Carrie'l Salon and Spa Administration"; mm.Body += "Thank you for using Carrie'l Salon and Spa's Password Retrieval System."; mm.Body += "\r\n\r\nHere is your information:"; mm.Body += "\r\n\r\nEmail:\t" + customer.CustomerEmail; mm.Body += "\r\nPassword:\t" + customer.CustomerPassword; mm.Body += "\r\n\r\nhttp://www.Carriel.ca"; try { SmtpMail.Send(mm); } catch{} lblErr.Visible = true; lblErr.Text = "Your password has been sent."; pnlEmail.Visible = false; btnCont.Visible = true; } else { lblErr.Visible = true; lblErr.Text = "Error: Sorry, we could not find that email address."; } } }
private void EmailOrder() { BPGiftCards bp = new BPGiftCards(); DSGiftcards = bp.SelectGiftCardsByID(Convert.ToInt32(GiftCardID)); BEGiftCards.tbl_GiftCardsRow giftcard; giftcard = DSGiftcards.tbl_GiftCards.FindByGiftCardID(GiftCardID); BESetup setupInfo = new BESetup(); BPSetup bpSetup = new BPSetup(); setupInfo = bpSetup.SelectAll(); string email = ""; if (!giftcard.IsGiftCardSenderEmailNull()) { //email = "*****@*****.**"; email = giftcard.GiftCardSenderEmail; } if (email == null || email == "") { email = setupInfo.tbl_Setup[0].SetupEmailAddress1 + "; " + setupInfo.tbl_Setup[0].SetupEmailAddress2; } else { if (!setupInfo.tbl_Setup[0].IsSetupEmailAddress1Null()) { email += "; " + setupInfo.tbl_Setup[0].SetupEmailAddress1; } if (!setupInfo.tbl_Setup[0].IsSetupEmailAddress2Null()) { email += "; " + setupInfo.tbl_Setup[0].SetupEmailAddress2; } } StringBuilder body = GetShippingInfo(giftcard); StringBuilder body2 = DisplayCart (giftcard); StringBuilder body3 = CalculateTotals (giftcard); MailMessage mm = new MailMessage(); mm.To = email; mm.From = setupInfo.tbl_Setup[0].SetupEmailAddress1; mm.Subject = string.Format ("Carriel Receipt. Gift Card Receipt #{0}", GiftCardID); mm.Body = string.Format ("Gift Card Receipt #{0} <br>", GiftCardID) + body.ToString() + body2.ToString() + body3.ToString(); mm.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer; SmtpMail.Send (mm); }
private void btnSubmit_Click(object sender, EventArgs e) { string bodytext; if (!Page.IsValid) { lblError.Text = "Please enter all required fields."; lblError.Visible = true; return; } BESetup setupInfo = new BESetup(); BPSetup bpSetup = new BPSetup(); setupInfo = bpSetup.SelectAll(); SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer; //SmtpMail.SmtpServer = "mws.mail"; MailMessage mm = new MailMessage(); mm.To = setupInfo.tbl_Setup[0].SetupEmailAddress2; mm.From = "*****@*****.**"; mm.Subject = "Carriel - Career Form"; bodytext = "<H2>Name and Address</H2><br>"; bodytext += ("Name: " + name.Value + "<br>"); bodytext += ("Email: " + email.Value + "<br>"); bodytext += ("Phone: " + phone.Value + "<br>"); bodytext += ("Fax: " + fax.Value + "<br>"); bodytext += ("Address: " + address.Value + "<br>"); bodytext += ("Province/State/Territory: " + province.Value + "<br>"); bodytext += ("Country: " + country.Value + "<br>"); bodytext += ("PostalCode: " + postalcode.Value + "<br>"); bodytext += "<H2>Details</H2><br>"; bodytext += ("Position Applied For: " + position.Value + "<br>"); bodytext += ("Education: " + "<br>" + education.Value.Replace("\n", "<br>") + "<br><br>"); bodytext += ("Experience: " + "<br>" + experience.Value.Replace("\n", "<br>") + "<br><br>"); bodytext += ("Comments: " + "<br>" + comments.Value.Replace("\n", "<br>") + "<br><br>"); bodytext += "Submission Date: " + DateTime.Now + "\r"; mm.Body += bodytext; mm.BodyFormat = MailFormat.Html; try { SmtpMail.Send(mm); pnlCareerForm.Visible = false; pnlCareerComplete.Visible = true; } catch { } }
private void btnSubmit_Click(object sender, EventArgs e) { string bodytext; if (!Page.IsValid) { lblError.Text = "Please enter all required fields."; lblError.Visible = true; return; } BESetup setupInfo = new BESetup(); BPSetup bpSetup = new BPSetup(); setupInfo = bpSetup.SelectAll(); SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer; //SmtpMail.SmtpServer = "mws.mail"; MailMessage mm = new MailMessage(); mm.To = setupInfo.tbl_Setup[0].SetupEmailAddress1; //mm.To = "*****@*****.**"; mm.From = "*****@*****.**"; mm.Subject = "Carriel - Contact Form"; bodytext = "<H2>Name and Address</H2><br>"; bodytext += ("Name: " + name.Value + "<br>"); bodytext += ("Email: " + email.Value + "<br>"); bodytext += ("Phone: " + phone.Value + "<br>"); bodytext += ("Fax: " + fax.Value + "<br>"); bodytext += ("Address: " + address.Value + "<br>"); bodytext += ("Province/State/Territory: " + province.Value + "<br>"); bodytext += ("Country: " + country.Value + "<br>"); bodytext += ("City: " + postalcode.Value + "<br>"); bodytext += "<H2>Inquiries</H2><br>"; bodytext += ("Inquiry Subject: " + subject.Value + "<br>"); bodytext += "<H2>Comments and Questions</H2><br>"; bodytext += ("Comments: " + "<br>" + comments.Value.Replace("\n", "<br>") + "<br>"); bodytext += "Submission Date: " + DateTime.Now + "\r"; mm.Body += bodytext; mm.BodyFormat = MailFormat.Html; try { SmtpMail.Send(mm); // lblError.Visible = false; // lblSuccess.Visible = true; pnlEmailForm.Visible = false; pnlEmailComplete.Visible = true; } catch { //Response.Redirect (strMWRequestBad); // lblError.Visible = true; // lblSuccess.Visible = false; } //Response.Redirect (strMWRequestGood); }
private void LoadSetup() { BPSetup bpCat = new BPSetup(); BESetup ds = bpCat.SelectAll(); if(ds.tbl_Setup.Rows.Count>0) { BESetup.tbl_SetupRow category = ds.tbl_Setup[0]; if (!category.IsSetupEmailAddress1Null()) { txtEmail1.Text = category.SetupEmailAddress1; } if (!category.IsSetupEmailAddress2Null()) { txtEmail2.Text = category.SetupEmailAddress2; } if (!category.IsSetupEmailServerNull()) { txtEmailServer.Text = category.SetupEmailServer; } mSetupID = category.SetupID; ViewState["SetupID"] = mSetupID; lblTitle.Text = "Edit Setup Options"; } else { txtEmail1.Text = ""; txtEmail2.Text = ""; txtEmailServer.Text = ""; mSetupID = 0; lblTitle.Text = "Add Setup Options"; } }