namespace NPP.SmartSchedue.Api.Contracts.Core.Configuration;
///
/// 邮件配置
///
public class EmailConfiguration
{
///
/// 配置节点名称
///
public const string SectionName = "EmailNotification";
///
/// SMTP服务器地址
///
public string SmtpServer { get; set; } = "";
///
/// SMTP端口
///
public int SmtpPort { get; set; } = 587;
///
/// 发送者邮箱
///
public string SenderEmail { get; set; } = "";
///
/// 发送者密码
///
public string SenderPassword { get; set; } = "";
///
/// 发送者名称
///
public string SenderName { get; set; } = "NPP智能生产调度系统";
///
/// 是否启用SSL
///
public bool EnableSsl { get; set; } = true;
///
/// 超时时间(秒)
///
public int TimeoutSeconds { get; set; } = 30;
///
/// 是否启用邮件服务
///
public bool Enabled { get; set; } = true;
///
/// 验证配置是否有效
///
public bool IsValid()
{
return !string.IsNullOrWhiteSpace(SmtpServer) &&
SmtpPort > 0 &&
!string.IsNullOrWhiteSpace(SenderEmail) &&
!string.IsNullOrWhiteSpace(SenderPassword);
}
}