public static void SendRegisterMail(clsUser user, string title) { var sb = new StringBuilder(); sb.Append("Name: ").Append(user.Firstname).Append(" ").AppendLine(user.Lastname + ","); sb.Append("Payment Method: ").AppendLine(user.PaymentMethod); sb.Append("Amount Payed:").AppendLine(user.Cost.ToString()); sb.AppendLine(""); sb.AppendLine("For travel information contact:"); sb.AppendLine("David Smith"); sb.AppendLine("*****@*****.**"); sb.AppendLine("847 404 4938"); SendMail(user.Email, "*****@*****.**", title, sb.ToString(), false); SendMail(user.Email, "*****@*****.**", title, sb.ToString(), false); sb = new StringBuilder(); sb.Append("Name: ").Append(user.Firstname).Append(" ").AppendLine(user.Lastname); sb.Append("Email: ").AppendLine(user.Email); sb.Append("Address: ").AppendLine(user.Address); sb.Append("City: ").AppendLine(user.City); sb.Append("State: ").AppendLine(user.State); sb.Append("Zip: ").AppendLine(user.Zip); sb.Append("Phone: ").AppendLine(user.Phone); sb.Append("Payment Method: ").AppendLine(user.PaymentMethod); sb.Append("Amount Paid:").AppendLine(user.Cost.ToString()); SendMail("*****@*****.**", "*****@*****.**", title, sb.ToString(), false); SendMail("*****@*****.**", "*****@*****.**", title, sb.ToString(), false); }
protected void RegisterButton_Click(object sender, EventArgs e) { try { CreateCharge(); } catch (Exception ex) { Util.DisplayAlert(this, "Unable to process your credit card. Please verify the information or try another card. " + ex.Message); return; } var oUser = new clsUser { Firstname = FirstNameTextBox.Text.Trim(), Lastname = LastNameTextBox.Text.Trim(), Email = EmailTextBox.Text.Trim(), Address = AddressTextBox.Text.Trim(), City = CityTextBox.Text.Trim(), State = State.SelectedValue, Zip = ZipTextBox.Text.Trim(), Phone = PhoneNumberTextBox.Text.Trim(), PaymentMethod = PaymentDropDown.SelectedItem.Text, Cost = Convert.ToInt32(PaymentDropDown.SelectedValue) }; var tour = Request.QueryString["tour"]; var key = tour + "Title"; var tour_title = System.Configuration.ConfigurationManager.AppSettings[key]; var title = "Smith Events - " + tour_title.ToUpper(); Util.SendRegisterMail(oUser, title); Util.RegisterStartupScript(this, "alert('Thank you! You are now registered for " + title + "!" + "');window.location.href=window.location.href;"); }