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