This commit is contained in:
2025-04-02 16:18:06 +08:00
parent a5609f064a
commit bf499a4a0c
3 changed files with 21 additions and 13 deletions
+9 -1
View File
@@ -10,6 +10,8 @@ using System.Data;
using NPOI.SS.Formula.Functions;
using System.Reflection;
using System.Text;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
namespace BLL
@@ -104,7 +106,7 @@ namespace BLL
mail.Subject = $"关键事项超期预警提醒——{projectName}";
//mail.To.Add(user.Email);
mail.To.Add("1784803958@qq.com");
mail.To.Add("fuwei@cwcec.com");
//mail.To.Add("fuwei@cwcec.com");
mail.IsBodyHtml = true;//确保邮件正文被当作HTML解析
StringBuilder tbodyStr = new StringBuilder();
@@ -205,6 +207,12 @@ namespace BLL
/// <param name="mail"></param>
private static bool PushEmail(MailMessage mail)
{
// 忽略SSL证书验证
ServicePointManager.ServerCertificateValidationCallback =
delegate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};
//获取发送邮箱配置
Email_Pop pops = BLL.Email_PopService.GetEmail_Pop("7EC5E991-B7A0-495A-90ED-2BE15370C959");
if (pops != null)