Abstracting MailMessage

This commit is contained in:
Elitsa Marinovska
2020-10-22 15:08:07 +02:00
parent e9ae1a93c3
commit d7eca3d0d5
9 changed files with 68 additions and 60 deletions

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Runtime.Serialization;
using System.Security.Cryptography;
using System.Threading.Tasks;
@@ -543,12 +542,9 @@ namespace Umbraco.Web.BackOffice.Controllers
UmbracoUserExtensions.GetUserCulture(to.Language, _localizedTextService, _globalSettings),
new[] { userDisplay.Name, from, message, inviteUri.ToString(), fromEmail });
var mailMessage = new MailMessage()
var mailMessage = new EmailMessage(fromEmail, to.Email, emailSubject, emailBody)
{
Subject = emailSubject,
Body = emailBody,
IsBodyHtml = true,
To = { to.Email}
IsBodyHtml = true
};
await _emailSender.SendAsync(mailMessage);