private void SendNow()
        {
            bool   isSendCopy = ctrlGiftRegistryShareForm.IsSendMeCopy;
            var    emails     = ctrlGiftRegistryShareForm.GetEmailAddresses();
            string subject    = ctrlGiftRegistryShareForm.Subject;

            if (emails.Count() == 0)
            {
                DisplayError(new List <string>()
                {
                    AppLogic.GetString("editgiftregistry.error.20", ThisCustomer.SkinID, ThisCustomer.LocaleSetting)
                });
                return;
            }

            //decode since we will not going to save it to the database.
            string htmlMessage = ctrlGiftRegistryShareForm.HtmlMessage.ToHtmlDecode();

            var param = new XElement(DomainConstants.XML_ROOT_NAME);

            param.Add(new XElement("MAIL_SUBJECT", subject));
            param.Add(new XElement("MAIL_BODY", htmlMessage));

            //param.Add(new XElement("REGISTRY_LINK", ));
            var    package = new XmlPackage2("notification.emailgiftregistry.xml.config", param);
            string html    = package.TransformString();

            string[] emailacctinfo = InterpriseHelper.GetStoreEmailAccountInfo();

            try
            {
                foreach (var email in emails)
                {
                    AppLogic.SendMailRequest(subject, htmlMessage, true, emailacctinfo[0], emailacctinfo[1], email, email, string.Empty);
                }

                //MailSerder.SendMail(subject, "*****@*****.**", html, SkinID);
                if (isSendCopy)
                {
                    AppLogic.SendMailRequest(subject, htmlMessage, true, emailacctinfo[0], emailacctinfo[1], ThisCustomer.EMail, ThisCustomer.FullName, string.Empty);
                    //MailSerder.SendMail(subject, ThisCustomer.EMail, html, SkinID);
                }

                ctrlGiftRegistryShareForm.ClearTextBox();

                DisplayError(new List <string>()
                {
                    AppLogic.GetString("editgiftregistry.aspx.45", ThisCustomer.SkinID, ThisCustomer.LocaleSetting)
                });
            }
            catch (Exception)
            {
                DisplayError(new List <string>()
                {
                    AppLogic.GetString("editgiftregistry.error.19", ThisCustomer.SkinID, ThisCustomer.LocaleSetting)
                });
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                String        FromAddress = txtFromAddress.Text;
                String        ToAddress   = txtToAddress.Text;
                String        BotAddress  = AppLogic.AppConfig("ReceiptEMailFrom");
                String        Subject     = AppLogic.AppConfig("StoreName") + " - " + SE.MungeName(ProductName);
                StringBuilder Body        = new StringBuilder(4096);

                List <XmlPackageParam> runtimeParams = new List <XmlPackageParam>();
                runtimeParams.Add(new XmlPackageParam("Subject", Subject));
                runtimeParams.Add(new XmlPackageParam("ItemCode", ItemCode));
                runtimeParams.Add(new XmlPackageParam("UserCode", InterpriseHelper.ConfigInstance.UserCode));

                Body.Append(
                    AppLogic.RunXmlPackage(
                        "notification.emailproduct.xml.config",
                        null,
                        ThisCustomer,
                        SkinID,
                        string.Empty,
                        runtimeParams,
                        false,
                        false
                        )
                    );

                try
                {
                    //get email account information assigned to this website
                    string[] defaultemailacctinfo = InterpriseHelper.GetStoreEmailAccountInfo();
                    string   fromemailacccode     = defaultemailacctinfo[0];

                    if (fromemailacccode.IsNullOrEmptyTrimmed())
                    {
                        emailproduct_aspx_8.Text = AppLogic.GetString("emailproduct.aspx.24", SkinID, ThisCustomer.LocaleSetting);
                    }
                    else
                    {
                        AppLogic.SendMail(Subject, Body.ToString(), true, BotAddress, BotAddress, ToAddress, ToAddress, String.Empty, AppLogic.AppConfig("MailMe_Server"));
                        emailproduct_aspx_8.Text = AppLogic.GetString("emailproduct.aspx.8", SkinID, ThisCustomer.LocaleSetting);
                    }
                }

                catch (Exception ex)
                {
                    emailproduct_aspx_8.Text = String.Format(AppLogic.GetString("emailproduct.aspx.9", SkinID, ThisCustomer.LocaleSetting), CommonLogic.GetExceptionDetail(ex, "<br>"));
                }

                pnlSuccess.Visible          = true;
                pnlRequireReg.Visible       = false;
                pnlEmailToFriend.Visible    = false;
                ReturnToProduct.Text        = AppLogic.GetString("emailproduct.aspx.10", SkinID, ThisCustomer.LocaleSetting);
                ReturnToProduct.NavigateUrl = SE.MakeProductLink(productID.ToString(), SEName);
            }
            else
            {
                InitializePageContent();
            }
        }