Example #1
0
        private MailMessage BuildMailMessage(Email email, bool isHtml)
        {
            var message = new MailMessage
            {
                From       = new MailAddress(_senderEmail),
                Subject    = email.Subject,
                IsBodyHtml = isHtml,
                Body       = email.Body,
            };

            message.To.Add(new MailAddress(email.Receiver));

            if (_emailsToCopy.Count > 0)
            {
                message.AddCopyEmails(_emailsToCopy);
            }

            return(message);
        }