日期:2014-05-20  浏览次数:21021 次

关于邮件的解码问题,RETR,POP3,邮件,附件,解码,邮件接收
大家好,我C#.net(.NET   Framework   2.0)中做一个邮件接收的程序。
利用里面的命名空间:
using   System.Net;
using   System.Net.Mail;
using   System.Net.Mime;
using   System.Net.Sockets;
using   System.IO;
using   System.Threading;

还使用了这些:
……
TcpClient   tcpcnt=   new   TcpClient(txtPop3Server.Text,   110);
……
NetworkStream   ns   =   null;
ns   =   tcpcnt.GetStream();
StreamReader   sr   =   new   StreamReader(ns);
      ……
                         
现在遇到了问题,请大家来帮我看看。

我通过POP3中的RETR指令从我自己的邮箱(luyangfree@126.com)中接收里面
的邮件。
我的邮件里的内容是:
邮件的主题是:attachment
邮件的内容是:This   is   txt   attachment.
邮件的附件是一个文本文件(ERR.txt),
文本文件里面的内容是:-ERR   Unable   to   log   on


以下是我邮件接收返回的信息:


  +OK   2773   octets
Received:   from   mu-out-0910.google.com   (unknown   [209.85.134.191])
by   mx15   (Coremail)   with   SMTP   id   wKjSpLDb7_LgJ+FFePnUEA==.40756S2;
Sun,   25   Feb   2007   14:08:33   +0800   (CST)
Received:   by   mu-out-0910.google.com   with   SMTP   id   g7so877445muf
                for   <luyangfree@126.com> ;   Sat,   24   Feb   2007   22:08:29   -0800   (PST)
DKIM-Signature:   a=rsa-sha1;   c=relaxed/relaxed;
                d=gmail.com;   s=beta;
                h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
                b=R22Hv9U/n2fRhBbb/cMdNqp8eW80Q75Gir/xQON0UU1QpXi3iRLYX6ibHyItAQ/MQG4QBrfKj6PcbtcUTQ23TYRSHT8CacRXO0OY2uN+FkF51SMSdKWwVqSPtk+obZn+V4zjqFn1W3sU41pQ4kzLekPDhhRmJGJO6Z9sv8LXHvY=
DomainKey-Signature:   a=rsa-sha1;   c=nofws;
                d=gmail.com;   s=beta;
                h=received:message-id:date:from:to:subject:mime-version:content-type;
                b=kZEGW9fKxQLYjlL7VMI/WzpcZOY54q4IfVI7IWezg96dARAtpAj3fpl/NuySfuDhE3GOPxv7Tv79ClOKrKzwALURE4oJhoDEY/oyl7PeOldFYJzzk0oB3/ZXAJz6oOyvBfzXcUAN0F6q/AlFClV0cMLqB576uD0aV3/NaKDKmhI=
Received:   by   10.82.135.13   with   SMTP   id   i13mr1228808bud.1172383708921;
                Sat,   24   Feb   2007   22:08:28   -0800   (PST)
Received:   by   10.82.189.3   with   HTTP;   Sat,   24   Feb   2007   22:08:28   -0800   (PST)
Message-ID:   <f9a9dfa70702242208j75854c3er4c40ab858c11414e@mail.gmail.com>
Date:   Sun,   25   Feb   2007   14:08:28   +0800
From:   "=?GB2312?B?wr3R7g==?= "   <luyangfree@gmail.com>
To:   luyangfree@126.com
Subject:   attachment
MIME-Version:   1.0
Content-Type:   multipart/mixed;  
boundary= "----=_Part_49134_11090661.1172383708899 "
X-Coremail-Antispam:   1U3Yxn0WfASr-VFAUDIcSsGvfJT3xCjnVCjjxCrMxkI7II2jI
8vz4v_Cr0_Zr1lYx0Ex4A2jsIE14v26r4UJVWxJr1l6VACY4xI67k04243AwACY4xI67k0
4243AVC20s07MxkFs20EbsIEYx1lYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lc2xSY4AK6IIF6r