Пример #1
0
        public Pop3Message(long position, long size, Socket client)
        {
            m_inboxPosition = position;
            m_messageSize   = size;
            m_client        = client;

            m_pop3State            = new Pop3StateObject();
            m_pop3State.workSocket = m_client;
            m_pop3State.sb         = new StringBuilder();

            // load email ...
            LoadEmail();

            // get body (if it exists) ...
            IEnumerator multipartEnumerator =
                MultipartEnumerator;

            while (multipartEnumerator.MoveNext())
            {
                Pop3Component multipart = (Pop3Component)
                                          multipartEnumerator.Current;

                if (multipart.IsBody)
                {
                    m_body = multipart.Data;
                    break;
                }
            }
        }
Пример #2
0
        private void LoadEmail()
        {
            // tell pop3 server we want to start reading
            // email (m_inboxPosition) from inbox ...
            string s = Pop3Client.SendReceive(m_client, "RETR " + m_inboxPosition, true);

            // parse email ...
            ParseEmail(s.ToString().Split(new char[] { '\r' }));


            // remove reading pop3State ...
            m_pop3State = null;
        }