Esempio n. 1
0
 protected void SubscribeEmail(object sender, EventArgs e)
 {
     if (SubscribeEmailBL.InsertUserEmail(txtEmail.Text) == "1")
     {
         Response.Redirect("/ThankYou.aspx");
     }
 }
Esempio n. 2
0
        protected void SendLetter(object sender, EventArgs e)
        {
            try
            {
                DataSet   ds      = new DataSet();
                string    subject = txtSubject.Text;
                string    content = txtContent.Text;
                DataTable dt      = new DataTable();

                ds = SubscribeEmailBL.GetAllEmails();
                dt = ds.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    string emailId = dr["EmailId"].ToString();
                    SendMail.SendNewsLetter(subject, emailId, content);
                }
                txtStatus.Text = "Newsletter sent successfully";
            }
            catch (Exception ex)
            {
                txtStatus.Text = "Error while sending the newsletter.";
                ex.SendMail();
            }
        }