1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- namespace PMS.Plugins.Email
- {
- /// <summary>
- /// 服务器信息
- /// </summary>
- [Serializable]
- public class EmailServerInfo : ICloneable
- {
- /// <summary>
- /// 邮件发送服务器相关配置
- /// </summary>
- /// <param name="host">主机协议</param>
- /// <param name="sendName">发送者名称</param>
- /// <param name="email">发送者邮件</param>
- /// <param name="password">发送者密码</param>
- /// <param name="port">发送端口</param>
- public EmailServerInfo(string host, string sendName, string email, string password, int port = 25)
- {
- this.Host = host;
- this.Port = port;
- this.SendUserName = sendName;
- this.SendEmail = email;
- this.SendEmailPassword = password;
- }
- /// <summary>
- /// 邮件服务器主机:例如,smtp.zlsoft.cn
- /// </summary>
- [Category("1.邮件服务器")]
- [Description("邮件服务器主机地址,用于发送邮件,例如: mail.zlsoft.cn")]
- public string Host { get; set; }
- /// <summary>
- /// 邮件发送端口,默认为25
- /// </summary>
- [Category("1.邮件服务器")]
- [Description("邮件服务器主机端口,默认stmp使用25")]
- public int Port { get; set; }
- /// <summary>
- /// 是否使用SSL
- /// </summary>
- [Category("1.邮件服务器")]
- [Description("是否使用安全的SSL发送,默认为false")]
- public bool EnableSSL { get; set; }
- /// <summary>
- /// 发送者名称
- /// </summary>
- [Category("2.发送人信息")]
- [Description("邮件中发信者的名称")]
- public string SendUserName { get; set; }
- /// <summary>
- /// 送信者邮件
- /// </summary>
- [Category("2.发送人信息")]
- [Description("邮件发信人的具体邮件地址")]
- public string SendEmail { get; set; }
- /// <summary>
- /// 送信者的邮件密码
- /// </summary>
- [PasswordPropertyText(true)]
- [Category("2.发送人信息")]
- [Description("邮件发信人的具体邮件访问密码")]
- public string SendEmailPassword { get; set; }
- public object Clone()
- {
- return (EmailServerInfo)this.MemberwiseClone();
- }
- public override string ToString()
- {
- return "邮件服务器信息";
- }
- }
- }
|