示例#1
0
        /// <summary>
        /// Get max message number and mailbox size.
        /// </summary>
        /// <returns>PopStat object with the max message number and mailbox size.</returns>
        public PopStat SendStat()
        {
            PopCommandResponse response = SendCommand("STAT");
            PopStat            stat     = new PopStat();
            IList <int>        v        = response.IntValues();

            if (v.Count > 1)
            {
                stat.MessageNumber = v[0];
                stat.Size          = v[1];
            }
            return(stat);
        }
示例#2
0
        /// <summary>
        /// Get the size of a message
        /// </summary>
        /// <param name="intMessageNumber">message number</param>
        /// <returns>Size of message</returns>
        public PopStat List(int intMessageNumber)
        {
            if (!Connected)
            {
                throw new InvalidOperationException("You must be connected.");
            }

            PopCommandResponse response = SendCommand("LIST " + intMessageNumber.ToString());
            PopStat            stat     = new PopStat();
            IList <int>        v        = response.IntValues();

            stat.MessageNumber = v[0];
            stat.Size          = v[1];
            return(stat);
        }