예제 #1
0
        private MimeMessage CreateEmailMessage(Mesage mesage)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress(_emailConfig.From));
            emailMessage.To.AddRange(mesage.To);
            emailMessage.Subject = mesage.Subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = string.Format("<h2 style='color:red'>{0}<h2>", mesage.Content)
            };
            return(emailMessage);
        }
예제 #2
0
        public async Task SendEmailAsync(Mesage mesage)
        {
            var mailMessage = CreateEmailMessage(mesage);

            await SendAsync(mailMessage);
        }
예제 #3
0
        public void SendEmail(Mesage mesage)
        {
            var emaiMessage = CreateEmailMessage(mesage);

            Send(emaiMessage);
        }