// 根据班级发送文件 protected void BtnInformClas_Click(object sender, EventArgs e) { if (ddlClass.SelectedValue != "null") { // 发送邮件 EmailSender email = new EmailSender(); List <TuitionMS.DAL.Students> students = finSrv.GetClasStudent(ddlClass.SelectedValue); foreach (TuitionMS.DAL.Students s in students) { if (s.studEmail != "") { // 设置邮箱 email.SetEmailSender(s.studEmail); // 发送邮件 email.Send(subject, s.studName + content); } } lbMessage.Text = "通知成功!!"; } else { lbMessage.Text = "请选择班级"; } }