コード例 #1
0
ファイル: MimeMessage.cs プロジェクト: ewin66/Jep
        /// <summary>
        /// Build headers from To, CC, and BCC address from address list
        /// </summary>
        public void SaveAdr()
        {
            string to   = "";
            string cc   = "";
            string bcc  = "";
            string from = "";

            foreach (MailAddress adr in m_address_to)
            {
                if (to.Length > 0)
                {
                    to += ";";
                }
                to += adr.Src;
            }

            foreach (MailAddress adr in m_address_cc)
            {
                if (cc.Length > 0)
                {
                    cc += ";";
                }
                cc += adr.Src;
            }
            foreach (MailAddress adr in m_address_bcc)
            {
                if (bcc.Length > 0)
                {
                    bcc += ";";
                }
                bcc += adr.Src;
            }
            foreach (MailAddress adr in m_address_from)
            {
                if (from.Length > 0)
                {
                    from += ";";
                }
                from += adr.Src;
            }
            if (m_address_from.Count > 1 && m_address_sender.Mailbox.Length == 0)
            {
                m_address_sender = m_address_from[0];
            }

            if (m_address_sender != null &&
                m_address_sender.Mailbox.Length > 0)
            {
                m_headers["Sender"] = m_address_sender.Src;
            }

            if (from.Length > 0)
            {
                m_headers["From"] = from;
            }

            if (to.Length > 0)
            {
                m_headers["To"] = to;
            }
            if (cc.Length > 0)
            {
                m_headers["CC"] = cc;
            }
            if (bcc.Length > 0)
            {
                m_headers["BCC"] = bcc;
            }
        }
コード例 #2
0
ファイル: MailAddressList.cs プロジェクト: ewin66/Jep
 public override int IndexOf(MailAddress x)
 {
     return(m_collection.IndexOf(x));
 }
コード例 #3
0
ファイル: MailAddressList.cs プロジェクト: ewin66/Jep
 public override void Remove(MailAddress x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
コード例 #4
0
ファイル: MailAddressList.cs プロジェクト: ewin66/Jep
 public override bool Contains(MailAddress x)
 {
     return(m_collection.Contains(x));
 }