Consolidate at .NET version 4.6.2

This commit is contained in:
Jonathan Jenne
2023-01-24 14:50:01 +01:00
parent 2b96e4b60e
commit 054c32e0d5
37 changed files with 79 additions and 63 deletions

View File

@@ -3,7 +3,7 @@
<configSections>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@@ -17,5 +17,12 @@ Public Class Config
Public Property Debug As Boolean = False
Public Property TlsVersion As Security.Authentication.SslProtocols = Security.Authentication.SslProtocols.Default
Public Class TlsConfig
Public Property EnableDefault As Boolean = True
Public Property EnableTls1_1 As Boolean = False
Public Property EnableTls1_2 As Boolean = False
End Class
Public Property TlsVersion As New TlsConfig
End Class

View File

@@ -11,7 +11,7 @@
<AssemblyName>DDEmailService</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>

View File

@@ -349,7 +349,9 @@ Public Class EmailService
' ======= Connect to server =======
Dim oOptions As New MailSender.MailSenderOptions() With {
.TlsVersion = _Config.TlsVersion
.EnableTls1_1 = _Config.TlsVersion.EnableTls1_1,
.EnableTls1_2 = _Config.TlsVersion.EnableTls1_2,
.EnableDefault = _Config.TlsVersion.EnableDefault
}
Dim oResult = _MailSender.ConnectToServer(oAccount.Server, oAccount.Port, oAccount.Username, oAccount.Password, oAccount.AuthType, oOptions)