Browse Source

邮箱配置模型

yuzhengyang 4 years ago
parent
commit
78d56dc478

+ 81 - 0
Azylee.Utils/Azylee.Core/AppUtils/AppConfigUtils/AppConfigModels/AppConfigEmailItem.cs

@@ -0,0 +1,81 @@
+using Azylee.Core.AppUtils.AppConfigUtils.AppConfigInterfaces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Azylee.Core.AppUtils.AppConfigUtils.AppConfigModels
+{
+    /// <summary>
+    /// Email邮箱配置信息
+    /// </summary>
+    public class AppConfigEmailItem : IAppConfigItemModel
+    {
+        /// <summary>
+        /// 序号
+        /// </summary>
+        public int Number { get; set; }
+        /// <summary>
+        /// 邮箱地址
+        /// </summary>
+        public string MailAddress { get; set; }
+        /// <summary>
+        /// 用户名
+        /// </summary>
+        public string Username { get; set; }
+        /// <summary>
+        /// 邮箱密码
+        /// </summary>
+        public string Password { get; set; }
+        /// <summary>
+        /// 对邮件内容进行socket层加密传输,false表示不加密
+        /// </summary>
+        public bool SslEnable { get; set; }
+        /// <summary>
+        /// 对发件人邮箱进行密码验证,false表示不对发件人邮箱进行密码验证
+        /// </summary>
+        public bool PwdCheckEnable { get; set; }
+        /// <summary>
+        /// 发送邮件所用的端口号(htmp协议默认为25)
+        /// </summary>
+        public int Port { get; set; }
+
+        /// <summary>
+        /// 默认构造函数
+        /// </summary>
+        /// <param name="_number"></param>
+        /// <param name="_mailAddress"></param>
+        /// <param name="_username"></param>
+        /// <param name="_password"></param>
+        /// <param name="_sslEnable"></param>
+        /// <param name="_pwdCheckEnable"></param>
+        /// <param name="_port"></param>
+        public AppConfigEmailItem(int _number, string _mailAddress, string _username, string _password, bool _sslEnable = false, bool _pwdCheckEnable = false, int _port = 25)
+        {
+            Number = _number;
+            MailAddress = _mailAddress;
+            Username = _username;
+            Password = _password;
+            SslEnable = _sslEnable;
+            PwdCheckEnable = _pwdCheckEnable;
+            Port = _port;
+        }
+
+        /// <summary>
+        /// 排序序号
+        /// </summary>
+        /// <returns></returns>
+        public int GetOrderNumber()
+        {
+            return this.Number;
+        }
+        /// <summary>
+        /// 唯一名称
+        /// </summary>
+        /// <returns></returns>
+        public string GetUniqueName()
+        {
+            return this.MailAddress;
+        }
+    }
+}

+ 1 - 0
Azylee.Utils/Azylee.Core/Azylee.Core.csproj

@@ -49,6 +49,7 @@
     <Compile Include="AppUtils\AppConfigUtils\AppConfig.cs" />
     <Compile Include="AppUtils\AppConfigUtils\AppConfigInterfaces\IAppConfigItemModel.cs" />
     <Compile Include="AppUtils\AppConfigUtils\AppConfigModels\AppConfigDbItem.cs" />
+    <Compile Include="AppUtils\AppConfigUtils\AppConfigModels\AppConfigEmailItem.cs" />
     <Compile Include="AppUtils\AppConfigUtils\AppConfigModels\AppConfigFileItem.cs" />
     <Compile Include="AppUtils\AppConfigUtils\AppConfigModels\AppConfigItem.cs" />
     <Compile Include="AppUtils\AppConfigUtils\AppConfigModels\AppConfigRegionModel.cs" />