一:收邮件

     1.  /**
             * 首先使用POP3,必须创建一个POP3_Client的对象
             * 然后通过Connect和Login进行连接和登录处理
            */
            POP3_Client pop3 = new POP3_Client();

            pop3.Connect(Utils.popServer, Utils.popPort,Utils.popUseSsl);
            pop3.Login(Utils.userName, Utils.password);

            (注意1.其中的popServer,popPort一定要输入正确,常见的见http://wenda.so.com/q/1414085404723713?src=140,本人用的163,popServer为pop.163.com,popPort为110,popUserSsl为false;)

   2.      /**
                 * POP3的的邮件下载通过POP3_Client 对象的属性Messages对象进行
                 * 每个POP3_ClientMessage代表一份完整的邮件信息
                 * 一开始应该是只是获取一些简单的邮件信息(其中包括邮件的唯一标识UID)
                 * 这样才能提高POP3协议的处理速度
                 */
                
             POP3_ClientMessageCollection infos = pop3.Messages

    for (int i =infos.Count-1; i >= 0; i--){//因为邮件为时间从大到小排序,所以我在这里倒序循环

      POP3_ClientMessage message = infos[i];//获取到第i封邮件

      string UID = message.UID;//message.UID为全球唯一标识邮件的id

      byte[] headerBytes = Encoding.UTF8.GetBytes(message.HeaderToString());//获取头部信息以bute[]形式接收

      Mail_Message header = Mail_Message.ParseFromByte(headerBytes);//如果要继续解析邮件需转为Mail_Message对象

      //以下是解析日期,发件人,收件人以及邮件主题的信息

·      DateTime datetime=header.Date
                       string from= header.From;

       string  to=header.To;

                      string subject=header.Subject;

    }