protected void btn_add_Click(object sender, EventArgs e) { try { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); MailBSO mailBSO = new MailBSO(); mailBSO.EmailFrom = config.Email_from; EmailBSO emailBSO = new EmailBSO(); DataTable table = emailBSO.GetEmailAll(); string subject = txtTitle.Text; string body = txtRadFull.Html; for (int i = 0; i < table.Rows.Count; i++) mailBSO.SendMail(table.Rows[i]["EmailAddress"].ToString(), subject, body); clientview.Text = "Thư đã được gửi đến danh sách Người dùng"; } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } }
public void ViewEmail() { EmailBSO emailBSO = new EmailBSO(); DataTable table = emailBSO.GetEmailAll(); commonBSO commonBSO = new commonBSO(); commonBSO.FillToGridView(grvEmail, table); }