Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 2
0
        private void LoadEmail()
        {
            // tell pop3 server we want to start reading
            // email (m_inboxPosition) from inbox ...

            Send("retr "+m_inboxPosition);

            // start receiving email ...
            StartReceive();

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

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