mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Added SmtpEnableSsl to app settings for email sender. Added Windows Event Log provider to logging.
This commit is contained in:
parent
c824e8bfde
commit
0690a54c3d
@ -1 +1 @@
|
||||
2019.04.08.0720
|
||||
2019.04.10.0649
|
||||
|
||||
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -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" />
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
"SmtpUserName": "",
|
||||
"SmtpPassword": "",
|
||||
"SmtpEmail": "",
|
||||
"SmtpDisplayName": ""
|
||||
"SmtpDisplayName": "",
|
||||
"SmtpEnableSsl": true
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user