谢谢!private void btSend_Click(object sender, System.EventArgs e) { string zhusong = this.tbZs.Text.Trim();//文件的主送人 string baosong = this.tbBs.Text.Trim();//文件的报送人 string Subject = this.tbSubject.Text.Trim();//文件的主题 string Body = this.tbBody.Text;//文件的内容 string Priority = this.ddlPriority.SelectedValue;//文件的优先级 //文件的上传 string[] Attachments = new string[this.ddlUpFile.Items.Count]; for (int i=0;i<this.ddlUpFile.Items.Count;i++) { Attachments[i] = this.ddlUpFile.Items[i].Value; }
if (myemail.SendEmail(zhusong,bongsong,Subject,Body,Priority, Attachments)) { Page.RegisterClientScriptBlock("ok","<script language=c#>alert('发送成功')</script>"); } else { Page.RegisterClientScriptBlock("ok","<script language=c#>alert('发送失败')</script>"); } }