From d595408fa724acfd903a4c94305718919866d249 Mon Sep 17 00:00:00 2001 From: thisisnabi Date: Tue, 25 Jun 2024 22:55:10 +0330 Subject: [PATCH] Change email configuration structure --- src/Blogger.Infrastructure/Services/Externals/EmailService.cs | 2 +- .../Services/Externals/EmailSettings.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Blogger.Infrastructure/Services/Externals/EmailService.cs b/src/Blogger.Infrastructure/Services/Externals/EmailService.cs index 4ec0a6c..c33f387 100644 --- a/src/Blogger.Infrastructure/Services/Externals/EmailService.cs +++ b/src/Blogger.Infrastructure/Services/Externals/EmailService.cs @@ -14,7 +14,7 @@ public async Task SendAsync(string email, string subject, string content, Cancel using var smtpClient = new SmtpClient(_emailSettings.SmtpHost, _emailSettings.SmtpPort) { EnableSsl = true, - Credentials = new NetworkCredential(_emailSettings.From, _emailSettings.AppPassword) + Credentials = new NetworkCredential(_emailSettings.UserName, _emailSettings.Password) }; var mailMessage = new MailMessage diff --git a/src/Blogger.Infrastructure/Services/Externals/EmailSettings.cs b/src/Blogger.Infrastructure/Services/Externals/EmailSettings.cs index fb2b38c..127e28b 100644 --- a/src/Blogger.Infrastructure/Services/Externals/EmailSettings.cs +++ b/src/Blogger.Infrastructure/Services/Externals/EmailSettings.cs @@ -8,5 +8,7 @@ public class EmailSettings public int SmtpPort { get; set; } - public string AppPassword { get; set; } = null!; + public string UserName { get; set; } = null!; + + public string Password { get; set; } = null!; }