Skip to content

Commit

Permalink
Merge pull request #4479 from bdukes/starttls
Browse files Browse the repository at this point in the history
Automatically handle TLS negotiation for MailKit
  • Loading branch information
valadas authored Feb 10, 2021
2 parents d855265 + bedbc0d commit 739cf92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DNN Platform/Library/Services/Mail/MailKitMailProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace DotNetNuke.Services.Mail
using DotNetNuke.Entities.Host;
using DotNetNuke.Entities.Portals;

using MailKit.Net.Smtp;
using MailKit.Net.Smtp;
using MailKit.Security;

using MimeKit;

Expand Down Expand Up @@ -155,7 +156,7 @@ public override string SendMail(MailInfo mailInfo, SmtpInfo smtpInfo = null)
// to workaround problem in 4.0 need to specify host name
using (var smtpClient = new SmtpClient())
{
smtpClient.Connect(host, port, smtpInfo.EnableSSL);
smtpClient.Connect(host, port, SecureSocketOptions.Auto);

switch (smtpInfo.Authentication)
{
Expand Down

0 comments on commit 739cf92

Please sign in to comment.