Example #1
0
        protected void SendEmail_Click(object sender, EventArgs e)
        {
            if (txtEmail.Text.Length == 0)
            {
                ResultsText.Text = SueetieLocalizer.GetString("forgot_username_empty_email");
                return;
            }
            SueetieUser sueetieUser = SueetieUsers.GetSueetieUserByEmail(txtEmail.Text);

            if (String.IsNullOrEmpty(sueetieUser.UserName))
            {
                ResultsText.Text = SueetieLocalizer.GetString("forgot_username_notindatabase");
                return;
            }

            MailMessage msg = new MailMessage();

            AddFromAndSubject(msg, sueetieUser);
            AddBody(msg, sueetieUser);
            SendIt(msg);

            ResultsText.Text = SueetieLocalizer.GetString("forgot_username_sent_msg", new string[] { txtEmail.Text });
        }