Exemplo n.º 1
0
        public static void GetMailMainText(string filename)
        {
            System.IO.Stream m_Stream = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            MIMER.IMailReader reader = new MIMER.RFC2045.MailReader();
            MIMER.IEndCriteriaStrategy endofmessage = new MIMER.RFC2045.BasicEndOfMessageStrategy();
            MIMER.IMailMessage message = reader.Read(ref m_Stream, endofmessage);

            System.Console.WriteLine(message.TextMessage);
        }
Exemplo n.º 2
0
        public static void GetMainText(string filename)
        {
            System.IO.Stream m_Stream = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);

            MIMER.RFC2045.MailReader reader = new MIMER.RFC2045.MailReader();
            MIMER.IEndCriteriaStrategy endofmessage = new MIMER.RFC2045.BasicEndOfMessageStrategy();
            MIMER.RFC2045.IMimeMailMessage message = reader.ReadMimeMessage(ref m_Stream, endofmessage);

            System.Collections.Generic.IDictionary<string, string> allContents = message.Body;

            string strFile = allContents["text/html"];

            foreach (System.Collections.Generic.KeyValuePair<string, string> kvp in allContents)
            {
                System.Console.WriteLine(kvp.Key);
                System.Console.WriteLine(kvp.Value);
            } // Next kvp
        }