2025-12-26 15:21:31 +08:00
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Entity;
|
2025-12-25 11:20:56 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件消息实体
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class EmailMessage : BaseEntity
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件主题
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Subject { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件发送者
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string From { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件正文
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Body { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件HTML内容
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string HtmlBody { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邮件接收时间
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DateTime ReceivedDate { get; set; }
|
2025-12-26 15:21:31 +08:00
|
|
|
|
|
|
|
|
|
|
public string Md5 { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
public string ComputeBodyHash()
|
|
|
|
|
|
{
|
|
|
|
|
|
using var md5 = MD5.Create();
|
|
|
|
|
|
var inputBytes = System.Text.Encoding.UTF8.GetBytes(Body + HtmlBody);
|
|
|
|
|
|
var hashBytes = md5.ComputeHash(inputBytes);
|
|
|
|
|
|
return Convert.ToHexString(hashBytes);
|
|
|
|
|
|
}
|
2025-12-25 11:20:56 +08:00
|
|
|
|
}
|