From 80aaac997d5fa8e398a33467d8ed6f5d13f566ca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 25 Apr 2025 10:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=94=B6=E4=BB=B6=E4=BA=BA?= =?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/Email/SendEmailHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IRaCIS.Core.Application/Helper/Email/SendEmailHelper.cs b/IRaCIS.Core.Application/Helper/Email/SendEmailHelper.cs index 3179c16e1..04c2112c4 100644 --- a/IRaCIS.Core.Application/Helper/Email/SendEmailHelper.cs +++ b/IRaCIS.Core.Application/Helper/Email/SendEmailHelper.cs @@ -11,6 +11,12 @@ public static class SendEmailHelper public static async Task SendEmailAsync(MimeMessage messageToSend, SystemEmailSendConfig _systemEmailConfig, EventHandler? messageSentSuccess = null) { + //没有收件人 那么不发送 + if (messageToSend.To.Count == 0) + { + return; + } + try { using (var smtp = new MailKit.Net.Smtp.SmtpClient())