Skip to content

Commit ee5dca5

Browse files
committed
update version to 2.0.1
1 parent 3ee2f14 commit ee5dca5

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

NETCore.MailKit.sln

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.13
4+
VisualStudioVersion = 15.0.26730.16
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7C024949-45A0-4CBE-A70E-32B93819396B}"
77
EndProject
@@ -11,9 +11,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DA9FC7DA-E
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NETCore.MailKit", "src\NETCore.MailKit\NETCore.MailKit.csproj", "{96CC69A4-8F99-4AFD-9534-BE933C8798AC}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NETCore.MailKit.Web", "example\NETCore.MailKit.Web\NETCore.MailKit.Web.csproj", "{060CCE52-A73E-4384-AB4E-A1B546717AEB}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NETCore.MailKit.Web", "example\NETCore.MailKit.Web\NETCore.MailKit.Web.csproj", "{060CCE52-A73E-4384-AB4E-A1B546717AEB}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NETCore.MailKit.Tests", "test\NETCore.MailKit.Tests\NETCore.MailKit.Tests.csproj", "{ADEE50A3-4ADF-470F-9F56-071B6351D196}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NETCore.MailKit.Tests", "test\NETCore.MailKit.Tests\NETCore.MailKit.Tests.csproj", "{ADEE50A3-4ADF-470F-9F56-071B6351D196}"
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BD99E202-83A7-4FD2-BDF9-60E984354951}"
1919
ProjectSection(SolutionItems) = preProject
@@ -47,4 +47,7 @@ Global
4747
{060CCE52-A73E-4384-AB4E-A1B546717AEB} = {716AF6BD-9EC2-4489-B4B3-5E6FE59C6A06}
4848
{ADEE50A3-4ADF-470F-9F56-071B6351D196} = {DA9FC7DA-E56B-4A2E-BC27-89FA74919D08}
4949
EndGlobalSection
50+
GlobalSection(ExtensibilityGlobals) = postSolution
51+
SolutionGuid = {42DE4017-49C0-4EFF-A5FE-9328C0AB7F7D}
52+
EndGlobalSection
5053
EndGlobal

src/NETCore.MailKit/Core/EmailService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,19 @@ private void SendEmail(string mailTo, string mailCc, string mailBcc, string subj
173173
//add mail to
174174
foreach (var to in _to)
175175
{
176-
mimeMessage.To.Add(new MailboxAddress("", to));
176+
mimeMessage.To.Add(MailboxAddress.Parse(to));
177177
}
178178

179179
//add mail cc
180180
foreach (var cc in _cc)
181181
{
182-
mimeMessage.Cc.Add(new MailboxAddress("", cc));
182+
mimeMessage.Cc.Add(MailboxAddress.Parse(cc));
183183
}
184184

185185
//add mail bcc
186186
foreach (var bcc in _bcc)
187187
{
188-
mimeMessage.Bcc.Add(new MailboxAddress("", bcc));
188+
mimeMessage.Bcc.Add(MailboxAddress.Parse(bcc));
189189
}
190190

191191
//add subject

src/NETCore.MailKit/Infrastructure/Internal/MailKitOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public MailKitOptions()
4242
public string Password { get; set; }
4343

4444
/// <summary>
45-
/// enable ssl
45+
/// enable security
4646
/// </summary>
47-
public bool SSL { get; set; } = false;
47+
public bool Security { get; set; } = false;
4848
}
4949
}

src/NETCore.MailKit/MailKitProvider.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ private SmtpClient InitSmtpClient()
4040
var client = new SmtpClient();
4141

4242
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
43-
if (!Options.SSL)
43+
44+
45+
if (!Options.Security)
4446
{
4547
client.Connect(Options.Server, Options.Port, SecureSocketOptions.None);
4648
}
4749
else
4850
{
49-
client.Connect(Options.Server, Options.Port, SecureSocketOptions.SslOnConnect);
51+
// fix issue #6
52+
client.Connect(Options.Server, Options.Port, SecureSocketOptions.Auto);
5053
}
5154

5255
// Note: since we don't have an OAuth2 token, disable
@@ -81,7 +84,7 @@ private Pop3Client InitPop3Client()
8184
var client = new Pop3Client();
8285

8386
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
84-
client.Connect(Options.Server, Options.Port, Options.SSL);
87+
client.Connect(Options.Server, Options.Port, Options.Security);
8588

8689
// Note: since we don't have an OAuth2 token, disable
8790
// the XOAUTH2 authentication mechanism.
@@ -114,7 +117,7 @@ private ImapClient InitImapClient()
114117
{
115118
var client = new ImapClient();
116119

117-
client.Connect(Options.Server, Options.Port, Options.SSL);
120+
client.Connect(Options.Server, Options.Port, Options.Security);
118121

119122
// Note: since we don't have an OAuth2 token, disable
120123
// the XOAUTH2 authentication mechanism.

src/NETCore.MailKit/NETCore.MailKit.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<Version>2.0.0</Version>
6+
<Version>2.0.1</Version>
77
<Authors>Lvcc</Authors>
88
<Company />
99
<Description>MailKit extension for asp.net core. Easy send email in asp.net core project.</Description>
@@ -12,13 +12,13 @@
1212
<RepositoryUrl>https://github.com/myloveCc/NETCore.MailKit</RepositoryUrl>
1313
<PackageTags>MailKit ASP.NETCore</PackageTags>
1414
<RepositoryType>git</RepositoryType>
15-
<AssemblyVersion>2.0.0.0</AssemblyVersion>
16-
<FileVersion>2.0.0.0</FileVersion>
15+
<AssemblyVersion>2.0.1.0</AssemblyVersion>
16+
<FileVersion>2.0.1.0</FileVersion>
1717
<PackageReleaseNotes>MailKit ASP.NETCore 2.0.0 ,update to .net core 2.0 rtm.</PackageReleaseNotes>
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="MailKit" Version="1.18.0" />
21+
<PackageReference Include="MailKit" Version="1.18.1.1" />
2222
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
2323
</ItemGroup>
2424

0 commit comments

Comments
 (0)