示例#1
0
文件: MailAddress.cs 项目: ewin66/Jep
        /// <summary>
        /// The method builds the mime src (the valid RFC2822  address)
        /// </summary>
        protected void Save()
        {
            if (m_name.Length > 0)
            {
                if (QPEncoder.IsAscii(m_name))
                {
                    m_src = m_name + " " + m_mailbox;
                }
                else
                {
                    m_src = MimeWordEncoder.Encode(m_name, Config.defaultEncoding, EncodingIdentifier.Base64) + " " + m_mailbox;
                }
            }
            else
            {
                m_src = m_mailbox;
            }

            m_valid = true;
        }
示例#2
0
文件: MimeMessage.cs 项目: ewin66/Jep
        /// <summary>
        /// Initializes the message subject
        /// </summary>
        /// <param name="subject">A string containing the subject text</param>
        /// <param name="TransferEncoding">The encoding method for subject (choose base64 for unicode)</param>
        public void SetSubject(string subject, MimeTransferEncoding TransferEncoding)
        {
            switch (TransferEncoding)
            {
            case MimeTransferEncoding.Ascii7Bit:
                m_headers["Subject"] = subject + "\r\n";
                break;

            case MimeTransferEncoding.QuotedPrintable:
                m_headers["Subject"] = MimeWordEncoder.Encode(subject,
                                                              Config.defaultEncoding, // use System charset as default
                                                              EncodingIdentifier.QuotedPrintable);
                break;

            case MimeTransferEncoding.Base64:
                m_headers["Subject"] = MimeWordEncoder.Encode(subject,
                                                              Config.defaultEncoding,
                                                              EncodingIdentifier.Base64);
                break;
            }
        }
示例#3
0
文件: MimeMessage.cs 项目: ewin66/Jep
 /// <summary>
 /// Initializes the message subject. Subject is MimeWord encoded utf8 base64
 /// </summary>
 /// <param name="subject">A string containing the subject text</param>
 public void SetSubject(string subject)
 {
     m_headers["Subject"] = MimeWordEncoder.Encode(subject,
                                                   Config.defaultEncoding, // OK for all unicode char
                                                   EncodingIdentifier.Base64);
 }