Пример #1
0
        protected void sendEmail_Click(object sender, EventArgs e)
        {
            //Regex emailRgx = new Regex(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
            if (!Page.IsValid)
            {
                return;
            }

            string recipientName         = toName.Text.Trim();
            string recipientEmailAddress = toEmail.Text.Trim();
            string senderName            = fromName.Text.Trim();
            string senderEmail           = fromEmail.Text.Trim();
            string emailMessage          = message.Text.Trim();

            if (String.IsNullOrEmpty(senderEmail) || String.IsNullOrEmpty(recipientEmailAddress))
            {
                return;
            }

            string id   = searchIdForEmail.Value;
            string type = searchTypeForEmail.Value;

            string tabType = Helper.GetTabType(type);
            string link    = String.Format("{0}Search.aspx?searchType={1}&searchId={2}{3}", SettingsHelper.SiteURL, type, id, tabType);

            EmailFunction.ShareSearchResult(recipientName, recipientEmailAddress, senderName, senderEmail, emailMessage, link);
            ResetTextBoxes();
        }
Пример #2
0
        public void ShareSearchResultTest()
        {
            string recipientName         = "David Boland";
            string recipientEmailAddress = "*****@*****.**";
            string senderName            = "Roshan Tandukar";
            string senderEmail           = "*****@*****.**";
            string message = "This is a test email";
            string link    = "http://www.bso.org";

            EmailFunction.ShareSearchResult(recipientName, recipientEmailAddress, senderName, senderEmail, message, link);
        }