Skip to content

Commit d5d16a2

Browse files
committed
chore: bump MailKit to 5.0.0
MailKit 5 replaced the SmtpCapabilities flags enum with a collection and SendAsync now takes an ISendRequest; update SmtpEmailService accordingly.
1 parent fb5ee3a commit d5d16a2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎Cron/Services/Email/Smtp/SmtpEmailService.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ private async Task<EmailSendResult> SendMail<T>(Contact to, EmailTemplate templa
6767

6868
await smtpClient.ConnectAsync(_options.Host, _options.Port, _options.EnableSsl, cancellationToken);
6969
_logger.LogTrace("Authenticating...");
70-
if (smtpClient.Capabilities.HasFlag(SmtpCapabilities.Authentication))
70+
if (smtpClient.Capabilities.Contains(SmtpCapability.Authentication))
7171
await smtpClient.AuthenticateAsync(_options.Username, _options.Password, cancellationToken);
7272

7373
_logger.LogTrace("Smtp client connected, sending email...");
7474

75-
await smtpClient.SendAsync(message, cancellationToken);
75+
await smtpClient.SendAsync(new SmtpSendRequest(message), cancellationToken);
7676
await smtpClient.DisconnectAsync(true, cancellationToken);
7777
_logger.LogTrace("Sent email");
7878

‎Directory.Packages.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageVersion Include="Hangfire.AspNetCore" Version="1.8.25" />
2020
<PackageVersion Include="Hangfire.PostgreSql" Version="1.21.1" />
2121
<PackageVersion Include="IDisposableAnalyzers" Version="4.0.8" />
22-
<PackageVersion Include="MailKit" Version="4.18.2" />
22+
<PackageVersion Include="MailKit" Version="5.0.0" />
2323
<PackageVersion Include="MessagePack" Version="3.1.12" />
2424
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="11.0.0-rc.3.26522.148" />
2525
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="11.0.0-rc.3.26522.148" />

0 commit comments

Comments
 (0)