Exemplo n.º 1
0
        public bool SendTestEmail(string email, EmailAccount emailAccount)
        {
            var subject = " Test Email";
            var message = "Thank you for using email sender. This is a sample email to test if emails are functioning.";
            //create a new email message
            var emailMessage = new EmailMessage()
            {
                IsEmailBodyHtml = true,
                EmailBody       = message,
                EmailAccount    = emailAccount,
                Subject         = subject,
                To          = email,
                CreatedDate = DateTime.Now,
                SendingDate = DateTime.Now,
                Tos         = new List <EmailMessage.UserInfo>()
                {
                    new EmailMessage.UserInfo("WebAdmin", email)
                }
            };

            return(_emailService.SendEmail(emailMessage, true));
        }