public void Send(GreetingMessage message)
        {
            var mailMessage =
                new MailMessage(
                    "*****@*****.**",
                    message.To,
                    message.Subject,
                    message.Body);

            smtpClient.Send(mailMessage);
        }
예제 #2
0
        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);
                }
            }
        }