version dumps
This commit is contained in:
parent
e62080c7c6
commit
93ffb7a432
22 changed files with 102 additions and 92 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using MailKit.Security;
|
||||
using MailKit.Net;
|
||||
using MimeKit;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
|
|
@ -13,10 +14,12 @@ namespace Yavsc.Services
|
|||
public sealed class MailKitSmtpClient : ISmtpClient
|
||||
{
|
||||
private readonly MailKit.Net.Smtp.SmtpClient _client;
|
||||
private readonly FormatOptions _Options;
|
||||
|
||||
public MailKitSmtpClient()
|
||||
{
|
||||
_client = new MailKit.Net.Smtp.SmtpClient();
|
||||
_Options = new FormatOptions();
|
||||
}
|
||||
|
||||
public int Timeout
|
||||
|
|
@ -37,7 +40,8 @@ namespace Yavsc.Services
|
|||
|
||||
public Task SendAsync(MimeMessage message, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return _client.SendAsync(message, cancellationToken);
|
||||
MailKit.SendRequest request = new MailKit.SendRequest(message);
|
||||
return _client.SendAsync(_Options, request, cancellationToken);
|
||||
}
|
||||
|
||||
public void Disconnect(bool quit)
|
||||
|
|
|
|||
|
|
@ -120,8 +120,9 @@ namespace Yavsc.Services
|
|||
};
|
||||
|
||||
msg.Subject = subject;
|
||||
var domain = new Uri(siteSettings.Authority).Host;
|
||||
msg.MessageId = MimeKit.Utils.MimeUtils.GenerateMessageId(
|
||||
siteSettings.Authority
|
||||
domain
|
||||
);
|
||||
using Yavsc.Interfaces.ISmtpClient sc = _smtpClientFactory.CreateClient();
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue