Пример #1
0
        /// <summary>
        /// get message info
        /// </summary>
        /// <param name="number">message number on server</param>
        /// <returns>Message object</returns>
        public MIMEParser.Message GetMessage(int intNumber, bool blnOnlyHeader)
        {
            OnMessageTransferBegan(EventArgs.Empty);

            MIMEParser.Message msg = FetchMessage("RETR " + intNumber.ToString(), blnOnlyHeader);

            OnMessageTransferFinished(EventArgs.Empty);

            return(msg);
        }
Пример #2
0
        /// <summary>
        /// get messages info
        /// </summary>
        /// <param name="intMessageNumber">message number</param>
        /// <returns>Message object</returns>
        public MIMEParser.Message GetMessageHeader(int intMessageNumber)
        {
            OnMessageTransferBegan(EventArgs.Empty);

            MIMEParser.Message msg = FetchMessage("TOP " + intMessageNumber.ToString() + " 0", true);

            OnMessageTransferFinished(EventArgs.Empty);

            return(msg);
        }
Пример #3
0
        /// <summary>
        /// fetches a message or a message header
        /// </summary>
        /// <param name="strCommand">Command to send to Pop server</param>
        /// <param name="blnOnlyHeader">Only return message header?</param>
        /// <returns>Message object</returns>
        public MIMEParser.Message FetchMessage(string strCommand, bool blnOnlyHeader)
        {
            _receiveFinish = false;
            if (!SendCommand(strCommand))
            {
                return(null);
            }

            try
            {
                string receivedContent = ReceiveContent(-1);

                MIMEParser.Message msg = new MIMEParser.Message(ref _receiveFinish, _basePath, _autoDecodeMSTNEF, receivedContent, blnOnlyHeader);

                WaitForResponse(_receiveFinish, WaitForResponseInterval);

                return(msg);
            }
            catch (Exception e)
            {
                Utility.LogError("FetchMessage():" + e.Message);
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// fetches a message or a message header
        /// </summary>
        /// <param name="strCommand">Command to send to Pop server</param>
        /// <param name="blnOnlyHeader">Only return message header?</param>
        /// <returns>Message object</returns>
        public MIMEParser.Message FetchMessage(string strCommand, bool blnOnlyHeader)
        {
            _receiveFinish=false;
            if(!SendCommand(strCommand))
                return null;

            try
            {
                string receivedContent=ReceiveContent(-1);

                MIMEParser.Message msg=new MIMEParser.Message(ref _receiveFinish,_basePath,_autoDecodeMSTNEF,receivedContent,blnOnlyHeader);

                WaitForResponse(_receiveFinish,WaitForResponseInterval);

                return msg;
            }
            catch(Exception e)
            {
                Utility.LogError("FetchMessage():"+e.Message);
                return null;
            }
        }