下面是一个pop3接收类的一个方法。
http://www.codeproject.com/csharp/pop3client.asp

解决方案 »

  1.   

    OpenPOP.NET(http://sourceforge.net/projects/hpop)
      

  2.   

    下面把所有邮件显示并显示附件并提供附件下载myJmail.POP3Class mypop3;
    mypop3.Connect("*****@***.**","*******","*******",110);
    mypop3.Logging=true;
    int stt,mailNum=1;
    myJmail.MessageClass Mail=new MessageClass();
    for(;mailNum<mypop3.Messages.Count;mailNum++)
    {
    Mail=(MessageClass)mypop3.Messages[mailNum];
    Mail.ContentTransferEncoding="base64";
    Mail.Encoding="base64";
    Mail.Charset="GB2312";
    Response.Write(Mail.Subject+"<br>");
    Response.Write("<font color='red'>发信人:</font>"+Mail.FromName+"<br><font color='red'>发信地址:</font>"+Mail.From+"<br>");
    Response.Write("<font color='red'>邮件内容:</font><br>"+Mail.Body+"<br><br><br>");
    Response.Write("<font color='red'>附件数:</font>"+Mail.Attachments.Count.ToString()+"<br>");
    string AttName="";
    for(int i=0;i<Mail.Attachments.Count;i++)
    {
    myJmail.Attachment att=Mail.Attachments[i];
    AttName=att.Name;
    ((stt=AttName.IndexOf("\""))!=-1)AttName=AttName.Substring(0,stt);
    if(File.Exists(Server.MapPath(".//Attachment//")+AttName)){File.Delete(Server.MapPath(".//Attachment//")+AttName);}
    att.SaveToFile(Server.MapPath(".\\Attachment\\")+AttName);
    Response.Write("<a href='"+Server.MapPath(".//Attachment//")+AttName+"'>"+AttName+"</a><br>");

    }
    }