public void SendNewsItems(FeedItem[] items, string[] addresses) { if (items == null) throw new ArgumentNullException(nameof(items)); foreach (var item in items) SendNewsItem(item, addresses); }
public void SendNewsItem(FeedItem item, string[] addresses) { if (item == null) throw new ArgumentNullException(nameof(item)); if (addresses == null) throw new ArgumentNullException(nameof(addresses)); if (addresses.Length < 1) return; var message = new MailMessage(); message.From = new MailAddress(senderAddress); foreach (var address in addresses) { message.To.Add(new MailAddress(address)); } message.Subject = item.Title; message.Body = item.Summary; message.IsBodyHtml = true; smtpClient.Send(message); }