mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
Use SSL instead of TLS when sending mail
This commit is contained in:
parent
303ef44a18
commit
c40b616265
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,8 @@ public Task SendAsync(IdentityMessage message)
|
|||
var siteConfig = new ApplicationDbContext().Configs.FirstOrDefault();
|
||||
|
||||
var smtp = new SmtpClient(siteConfig.SMTPServer, siteConfig.SMTPPort);
|
||||
if (siteConfig.UseTLSEncryption)
|
||||
smtp.EnableSsl = true; //This is misleading... We want TLS but all we have is SSL. Oh well.
|
||||
smtp.UseDefaultCredentials = false;
|
||||
smtp.Credentials = new NetworkCredential(siteConfig.SMTPUsername, siteConfig.SMTPPassword);
|
||||
var sMsg = new MailMessage(siteConfig.SMTPReturnAddress, message.Destination);
|
||||
|
|
Loading…
Reference in a new issue