mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-23 09:42:14 +00:00
yuck
This commit is contained in:
parent
a797d998fe
commit
3737da45ca
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,7 @@ public async Task SendAsync(IdentityMessage message)
|
||||||
var siteConfig = new ApplicationDbContext().Configs.FirstOrDefault();
|
var siteConfig = new ApplicationDbContext().Configs.FirstOrDefault();
|
||||||
|
|
||||||
var smtp = new SmtpClient(siteConfig.SMTPServer, siteConfig.SMTPPort);
|
var smtp = new SmtpClient(siteConfig.SMTPServer, siteConfig.SMTPPort);
|
||||||
|
smtp.UseDefaultCredentials = false;
|
||||||
if (siteConfig.UseTLSEncryption)
|
if (siteConfig.UseTLSEncryption)
|
||||||
smtp.EnableSsl = true; //This is misleading... We want TLS but all we have is SSL. Oh well.
|
smtp.EnableSsl = true; //This is misleading... We want TLS but all we have is SSL. Oh well.
|
||||||
smtp.UseDefaultCredentials = false;
|
smtp.UseDefaultCredentials = false;
|
||||||
|
@ -38,6 +39,7 @@ public async Task SendAsync(IdentityMessage message)
|
||||||
<p>" + CommonMark.CommonMarkConverter.Convert(message.Body) + "</p>";
|
<p>" + CommonMark.CommonMarkConverter.Convert(message.Body) + "</p>";
|
||||||
sMsg.Subject = $"[{siteConfig.SiteName}] " + message.Subject;
|
sMsg.Subject = $"[{siteConfig.SiteName}] " + message.Subject;
|
||||||
sMsg.IsBodyHtml = true;
|
sMsg.IsBodyHtml = true;
|
||||||
|
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
|
||||||
var db = new ApplicationDbContext();
|
var db = new ApplicationDbContext();
|
||||||
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Email sending...<br/><br/><strong>To:</strong> {sMsg.To}<br/><strong>Subject:</strong><br/>{sMsg.Subject}"));
|
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Email sending...<br/><br/><strong>To:</strong> {sMsg.To}<br/><strong>Subject:</strong><br/>{sMsg.Subject}"));
|
||||||
db.SaveChanges();
|
db.SaveChanges();
|
||||||
|
|
Loading…
Reference in a new issue