Exemple #1
0
        /// POP3メールサーバーへDELEコマンドを送信します。
        /// <summary>
        /// Send dele command to pop3 server.
        /// POP3メールサーバーへDELEコマンドを送信します。
        /// </summary>
        /// <param name="mailIndex"></param>
        /// <returns></returns>
        public Pop3CommandResult ExecuteDele(Int64 mailIndex)
        {
            DeleCommand cm = new DeleCommand(mailIndex);
            Pop3CommandResult rs = null;

            this.CheckAuthenticate();
            rs = this.Execute(cm);
            this.CheckResponseError(rs);
            return rs;
        }
Exemple #2
0
        /// 指定したMailIndexのメールをメールサーバーから削除します。
        /// <summary>
        /// Set delete flag to specify mail index.
        /// To complete delete execution,call quit command after calling dele command.
        /// 指定したMailIndexのメールに削除フラグをたてます。
        /// 実際に削除するにはさらにQUITコマンドで削除処理を完了させる必要があります。
        /// </summary>
        /// <param name="indexList"></param>
        /// <returns></returns>
        public Boolean DeleteMail(params Int64[] indexList)
        {
            DeleCommand cm = null;
            Pop3CommandResult rs = null;

            if (this.EnsureOpen() == Pop3ConnectionState.Disconnected) { return false; }
            if (this.TryAuthenticate() == false) { return false; }
            for (int i = 0; i < indexList.Length; i++)
            {
                cm = new DeleCommand(indexList[i]);
                rs = this.Execute(cm);
                if (rs.Ok == false) { return false; }
            }
            this.ExecuteQuit();
            return true;
        }