Click here to Skip to main content
15,915,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have checkbox and boundField mailid in gridview asp .net,i want to send mail to all checked box through the button click.
Posted
Updated 6-Dec-11 20:29pm
v2
Comments
Sergey Alexandrovich Kryukov 7-Dec-11 2:24am    
"Send mail to all checked box"?! Poor boxes... :-)
--SA

1 solution

C#
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");     
           }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900