I have an array of email addresses. I can send all email by using foreach(below). How can i send email only for either the first and second or the last and pre last element in given array?
string[] emails = storeEmails.Split(new char[] { ';' });
foreach (string emailTo in emails)
{
emailTemplate.Email = emailTo;
_eventService.SendEmail(emailTemplate, emailBody);
}