用户登录  |  用户注册
首 页商业源码原创产品编程论坛
当前位置:PB创新网文章中心.Net

第二部分,公共属性

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2009-03-16 15:55:35
接上
--------------------------------------
/// <summary>
/// 最多收件人数量
/// </summary>
public int RecipientMaxNum
{
    set
    {
        recipientmaxnum = value;
    }
}

/// <summary>
/// 邮件服务器域名和验证信息
/// 形如:"user:pass@www.server.com:25",也可省略次要信息。如"user:pass@www.server.com"或"www.server.com"
/// </summary>    
public string MailDomain
{
    set
    {
        string maidomain=value.Trim();
        int tempint;

        if(maidomain!="")
        {
            tempint=maidomain.IndexOf("@");
            if(tempint!=-1)
            {
            string str=maidomain.Substring(0,tempint);
                        MailServerUserName=str.Substring(0,str.IndexOf(":"));
                        MailServerPassWord=str.Substring(str.IndexOf(":")+1,str.Length-str.IndexOf(":")-1);
                        maidomain=maidomain.Substring(tempint+1,maidomain.Length-tempint-1);
            }
                tempint=maidomain.IndexOf(":");
            if(tempint!=-1)
            {
                mailserver=maidomain.Substring(0,tempint);
                        mailserverport=System.Convert.ToInt32(maidomain.Substring(tempint+1,maidomain.Length-tempint-1));
                    }
                    else
                    {
                        mailserver=maidomain;

                    }

                
                }

            }
        }


        /// <summary>
        /// 邮件服务器端口号
        /// </summary>    
        public int MailDomainPort
        {
            set
            {
                mailserverport=value;
            }
        }


        /// <summary>
        /// SMTP认证时使用的用户名
        /// </summary>
        public string MailServerUserName
        {
            set
            {
                if(value.Trim()!="")
                {
                    username=value.Trim();
                    ESmtp=true;
                }
                else
                {
                    username="";
                    ESmtp=false;
                }
            }
        }


        /// <summary>
        /// SMTP认证时使用的密码
        /// </summary>
        public string MailServerPassWord
        {
            set
            {
                password=value;
            }
        }    


        /// <summary>
        /// 邮件发送优先级,可设置为"High","Normal","Low"或"1","3","5"
        /// </summary>
        public string Priority
        {
            set
            {
                switch(value.ToLower())
                {
                    case "high":
                        priority="High";
                        break;

                    case "1":
                        priority="High";
                        break;

                    case "normal":
                        priority="Normal";
                        break;

                    case "3":
                        priority="Normal";
                        break;

                    case "low":
                        priority="Low";
                        break;

                    case "5":
                        priority="Low";
                        break;

                    default:
                        priority="Normal";
                        break;
                }
            }
        }


        /// <summary>
        /// 错误消息反馈
        /// </summary>       
        public string ErrorMessage
        {
            get
            {
                return errmsg;
            }
        }


        /// <summary>
        /// 服务器交互记录
        /// </summary>
        public string Logs
        {
            get
            {
                return logs;
            }
        }
       

        /// <summary>
        /// 是否HTML格式邮件
        /// </summary>
        public bool IsHTML
        {
            set
            {
                Html=value;
            }
        }


        /// <summary>
        /// 发件人地址
        /// </summary>
        public string MailFrom
        {
            set
            {
                From=value;
            }
        }


        /// <summary>
        /// 发件人姓名
        /// </summary>
        public string MailFromName
        {
            set
            {
                FromName=value;
            }
        }


        /// <summary>
        /// 邮件语言编码
        /// </summary>
        public string Language
        {
            set
            {
                Charset=value;
            }
        }

        /// <summary>
        /// 收件人姓名
        /// </summary>
        public string MailRecipientName
        {
            set
            {
                RecipientName=value;
            }
        }


        /// <summary>
        /// 是否需要SMTP验证
        /// </summary>
        public bool MailSMTPvalidate
        {
            set
            {
                ESmtp=value;
            }
        }

        /// <summary>
        /// 邮件标题
        /// </summary>
        public string MailSubject
        {
            set
            {
                Subject=value;
            }
        }

        /// <summary>
        /// 邮件内容
        /// </summary>
        public string MailBody
        {
            set
            {
                Body=value;
            }
        }

        /// <summary>
        /// 受件人数量
        /// </summary>
        public int MailRecipientNum
        {
            set
            {
                RecipientNum=value;
            }
        }

        /// <summary>
        /// HTML格式交互记录
        /// </summary>
        public string HTMLLogs
        {
            get
            {
                return htmllog;
            }
        }

----------------
完毕

Tags:

作者:佚名

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论

相关文章

PB创新网ourmis.com】Copyright © 2000-2009 . All Rights Reserved .
页面执行时间:2,812.50000 毫秒
Email:ourmis@126.com QQ:2322888 蜀ICP备05006790号