我在gridview asp .net中具有复选框和boundField mailid,我想通过单击按钮将邮件发送到所有复选框.

问题描述:

我在gridview asp .net中具有复选框和boundField mailid,我想通过单击按钮将邮件发送到所有选中的框.

i have checkbox and boundField mailid in gridview asp .net,i want to send mail to all checked box through the button click.

You'll have to make a loop for that,in GridView's event I assume you know how to access gridview's control

for (int i = 0; i < chkbox1.Length; i++)
           {
              System.Web.Helpers.WebMail.SmtpServer = "smtp.gmail.com";
       System.Web.Helpers.WebMail.SmtpPort = 587;
       System.Web.Helpers.WebMail.EnableSsl = true;
       System.Web.Helpers.WebMail.UserName = "emailID";
       System.Web.Helpers.WebMail.Password = "pwd";
       System.Web.Helpers.WebMail.From = "rsvps@example.com";

       System.Web.Helpers.WebMail.Send(chkbox1[i], "Confirmation Notification","Invitation");     
           }