using MimeKit.Text; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CommonTool.MailKit { /// /// 邮件内容实体 /// public class MailBodyEntity { ///// ///// 邮件文本内容 ///// //public string MailTextBody { get; set; } /// /// 邮件内容类型 /// public TextFormat MailBodyType { get; set; } = TextFormat.Html; /// /// 邮件附件集合 /// public List MailFiles { get; set; } /// /// 收件人 /// public List Recipients { get; set; } /// /// 抄送 /// public List Cc { get; set; } /// /// 密送 /// public List Bcc { get; set; } /// /// 发件人 /// public string Sender { get; set; } /// /// 发件人地址 /// public string SenderAddress { get; set; } /// /// 邮件主题 /// public string Subject { get; set; } /// /// 邮件内容 /// public string Body { get; set; } } public class MailFile { /// /// 邮件附件文件类型 例如:图片 MailFileType="image" /// public string MailFileType { get; set; } /// /// 邮件附件文件子类型 例如:图片 MailFileSubType="png" /// public string MailFileSubType { get; set; } /// /// 邮件附件文件路径 例如:图片 MailFilePath=@"C:\Files\123.png" /// public string MailFilePath { get; set; } } /// /// 邮件服务器基础信息 /// public class MailServerInformation { /// /// SMTP服务器支持SASL机制类型 /// public bool Authentication { get; set; } /// /// SMTP服务器对消息的大小 /// public uint Size { get; set; } /// /// SMTP服务器支持传递状态通知 /// public bool Dsn { get; set; } /// /// SMTP服务器支持Content-Transfer-Encoding /// public bool EightBitMime { get; set; } /// /// SMTP服务器支持Content-Transfer-Encoding /// public bool BinaryMime { get; set; } /// /// SMTP服务器在消息头中支持UTF-8 /// public string UTF8 { get; set; } } /// /// 邮件发送结果 /// public class SendResultEntity { /// /// 结果信息 /// public string ResultInformation { get; set; } = "发送成功!"; /// /// 结果状态 /// public bool ResultStatus { get; set; } = true; } /// /// 邮件发送服务器配置 /// public class SendServerConfigurationEntity { /// /// 邮箱SMTP服务器地址 /// public string SmtpHost { get; set; } /// /// 邮箱SMTP服务器端口 /// public int SmtpPort { get; set; } /// /// 是否启用IsSsl /// public bool IsSsl { get; set; } /// /// 邮件编码 /// public string MailEncoding { get; set; } /// /// 邮箱账号 /// public string SenderAccount { get; set; } /// /// 邮箱密码 /// public string SenderPassword { get; set; } } }