Happy new year everyone,
so I'm creating a contact form webpart for my event management system at the moment which has a checkbox "send to all attendees". I'm using the SPUtility.SendEmail method to send mails via smtp. For one recipient (chosen by a dropdown-menu, getting Mail-Adresses from a list "attendees" where the attendees mails are entered by getting it from user profile) it should work fine (works in another context, though).
So, to send mails to multiple recipients, I thought about getting the attendees mail-adresses (via linq-query) in a string-array and then use a foreach-loop in combination with SPUtility.SendEmail, but I think by clicking the "send" button this action will last several (too many?) seconds (I'm using SPUtility.SendEmail on another webpart to send registration confirmations, and if an attendee clicks on the "register" button, it lasts 1-2 seconds to get the response (using a virtual smtp server using googlemail as smtp)).
So my actual question is: Is there an efficient way to send bulk email over SendEmail or another method I'm missing?
Best regards, Dominik
edit1: Oh, and the case "no email" could occur. In this case I thought about adding nothing to string array but counting the occurances and giving a message to the enduser.