顶了,
1\SqlDataReader dataReader = this.ExtGetSetting(Username); 获取DataReader对象
2\Database dbase=new Database();实力话一个DB类
3\int mailID=this.GetMailID();  邮件的ID唯一性的

解决方案 »

  1.   

    以下几句怎么理解:
    1\SqlDataReader dataReader = this.ExtGetSetting(Username);//ExtGetSetting一个函数,返回一个SqlDataReader实例
    2\Database dbase=new Database();//DataBase是一个类,估计是进行数据库操作的
    3\int mailID=this.GetMailID();//一个整形,代表ID
    哪给朋友给我一份可以用的接收邮件的代码吧,搞了好久没搞定,谢谢!
      

  2.   

    jmail.POP3Class popMail = new jmail.POP3Class();
            jmail.Message mailMessage;
            jmail.Attachments atts; //建立附件集接口
            jmail.Attachment att; //建立附件接口
            //try
            //{
            popMail.Connect(EUser, EPwd, "pop.163.com", 110);
            
                if (popMail.Count > 0)
                {
                    
                    for (int i = 1; i <= popMail.Count; i++)
                    {
                        UID = popMail.GetMessageUID(i);//得到服务器上每封mail的UID                                              // 据此判断这封邮件是否是新邮件
                        int IfNew = objLogic.IfNewMail(UID);//在逻辑层写的一个函数判断数据库中是否有当前的UID
                        if (IfNew == 1)//如果不存在
                        {
                            mailMessage = popMail.Messages[i];
                            atts = mailMessage.Attachments;
                            mailMessage.Charset = "GB18030";
                            mailMessage.ISOEncodeHeaders = false;
                            From = mailMessage.From;
                            dtime = mailMessage.Date;
                            FromName = mailMessage.FromName;
                            Subject = mailMessage.Subject;
                            Body = mailMessage.Body;
                            #region 邮件大小的单位转换
                            string mSize = mailMessage.Size.ToString();
                            double imSize = Convert.ToDouble(mSize);
                            imSize *= 0.001;
                            string Size = Convert.ToString(imSize)+"KB";
                            #endregion // 邮件大小的单位转换
                            if (atts.Count == 0)
                            {
                                AppPath = "";
                            }
                            else
                            {
                                for (int j = 0; j < atts.Count; j++)
                                {
                                    att = atts[j];
                                    string attname = att.Name;
                                    AppPath = "e:\\attFile\\" + attname;
                                    try
                                    {
                                        att.SaveToFile("e:\\attFile\\" + attname);
                                    }
                                    catch(Exception ex)
                                    {
                                        
                                        File.Delete("e:\\attFile\\" + attname);
                                        att.SaveToFile("e:\\attFile\\" + attname);
                                    }
                                    
                                }
                            }
                            
                            att = null;
                            atts = null;
                            objLogic.InsertInBox(UID,Subject, Body, From, dtime, Size, AppPath, FromName);
                        }
                        
                    }
                    
                }
                //else
                //{
                //    Label1.Text = "没有新邮件!";
                //}
                //popMail.DeleteMessages();
                popMail.Disconnect();
                popMail = null;
            //}
            //catch
            //{
            //    Label1.Text = "请检测网络配置!";
            //}
                DataTable dt = new DataTable();
                dt = objLogic.SelectFromInbox();
                GridView1.DataSource = dt;
                GridView1.DataBind();
            
        }
      

  3.   

    我查了好多的关于jmail收取邮件的问题。给的代码都是和上面的代码一样。但是我自己调试的时候就老是抛异常“This function is not included in this version of jmail.”。我以为是我装的jmail版本太低了。我又在网上下载了最新的jmail。然后进行安装。再测试。但就是不成功。抛出异常的时候就是jpop.Connect(Euname,Epwd,server,port)这里。到底要怎样才可以啊?