예제 #1
0
 /// <summary>
 /// 增加一个须要暗送的收件人
 /// </summary>
 /// <param name="bcc">收件人地址</param>
 public void AddBcc(MailAddress bcc)
 {
     if (this.bcc == null)
     {
         this.bcc = new MailAddressc();
     }
     this.bcc.Add(bcc);
 }
예제 #2
0
        /// <summary>
        /// 增加一个新的收件人
        /// </summary>
        /// <param name="to">收件人地址</param>
        public void AddTo(MailAddress to)
        {
            if (this.to == null)
            {
                this.to = new MailAddressc();
            }

            this.to.Add(to);
        }
예제 #3
0
        /// <summary>
        /// 增加一个须要抄送的收件人
        /// </summary>
        /// <param name="cc">收件人地址</param>
        public void AddCc(MailAddress cc)
        {
            if (this.cc == null)
            {
                this.cc = new MailAddressc();
            }

            this.cc.Add(cc);
        }
예제 #4
0
        /// <summary>
        /// 对收件人集合进行数组联接处理
        /// </summary>
        /// <param name="mc">返回值表示是否出错</param>
        bool CAddress(MailAddressc mc)
        {
            if (mc == null || mc.Count == 0)
            {
                return(true);                                          //未有时直接退出
            }
            IEnumerator ie = mc.GetEnumerator();
            MailAddress ad;

            while (ie.MoveNext())
            {
                ad = (MailAddress)ie.Current;
                //输出一个收件人
                this.Dialog(string.Format("RCPT TO: <{0}>", ad.Address) + MailCommon.NewLine, "250", "work_006");               //完成  //成功输出一个收件人
            }

            return(true);
        }
예제 #5
0
        /// <summary>
        /// 创建指定邮件地址集合的数组,主要是开发人员使用
        /// </summary>
        /// <param name="coll">须要处理的集合</param>
        /// <returns>返回字符串型式数组</returns>
        protected virtual string CreateAddressList(MailAddressc coll)
        {
            string      list = "";
            IEnumerator ie   = coll.GetEnumerator();
            MailAddress ad;

            while (ie.MoveNext())
            {
                ad    = (MailAddress)ie.Current;
                list += this.EncodeType == MailEncodeType.BASE64 ? ad.Base64Encoding(this.Charset, this.SetCharset) : ad.QPEncoding(this.Charset, this.SetCharset);
                list += ",";
            }

            if (list.EndsWith(","))
            {
                list = list.Substring(0, list.Length - 1);
            }

            return(list);
        }