Added SmtpEnableSsl to app settings for email sender. Added Windows Event Log provider to logging.

This commit is contained in:
Jared Goodwin 2019-04-10 06:53:19 -07:00
parent c824e8bfde
commit 0690a54c3d
6 changed files with 11 additions and 3 deletions

View File

@ -1 +1 @@
2019.04.08.0720
2019.04.10.0649

View File

@ -7,6 +7,7 @@ using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Remotely_Shared.Services;
namespace Remotely_Server
{
@ -26,6 +27,10 @@ namespace Remotely_Server
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddConsole();
logging.AddDebug();
if (OSUtils.IsWindows)
{
logging.AddEventLog();
}
});
}
}

View File

@ -59,6 +59,7 @@
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.3" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />

View File

@ -30,6 +30,7 @@ namespace Remotely_Server.Services
public string SmtpPassword => Config["ApplicationOptions:SmtpPassword"];
public string SmtpEmail => Config["ApplicationOptions:SmtpEmail"];
public string SmtpDisplayName => Config["ApplicationOptions:SmtpDisplayName"];
public bool SmtpEnableSsl => bool.Parse(Config["ApplicationOptions:SmtpEnableSsl"]);
private IConfiguration Config { get; set; }

View File

@ -31,7 +31,7 @@ namespace Remotely_Server.Services
var mailClient = new SmtpClient();
mailClient.Host = AppConfig.SmtpHost;
mailClient.Port = AppConfig.SmtpPort;
mailClient.EnableSsl = true;
mailClient.EnableSsl = AppConfig.SmtpEnableSsl;
mailClient.Credentials = new NetworkCredential(AppConfig.SmtpUserName, AppConfig.SmtpPassword);
mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;

View File

@ -25,6 +25,7 @@
"SmtpUserName": "",
"SmtpPassword": "",
"SmtpEmail": "",
"SmtpDisplayName": ""
"SmtpDisplayName": "",
"SmtpEnableSsl": true
}
}