// 根据学院发送邮件 protected void BtnInformDept_Click(object sender, EventArgs e) { if (ddlDepartment.SelectedValue != "null") { // 发送邮件 EmailSender email = new EmailSender(); List <TuitionMS.DAL.Students> students = finSrv.GetDeptStudent(ddlDepartment.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 = "请选择学院"; } }