public void Send(GreetingMessage message) { var mailMessage = new MailMessage( "*****@*****.**", message.To, message.Subject, message.Body); smtpClient.Send(mailMessage); }
public void SendGreetings(XDate xDate) { List <Employee> employees = _employeeRepository.GetAll(); foreach (var employee in employees) { if (employee.IsBirthday(xDate)) { var greetingMessage = new GreetingMessage(employee); _greetingMessageService.SendMessage(greetingMessage); } } }