GridView1数据导出邮件发送为什么只能发送一条数据?
GridView里面有两条以上的数据
张三  身份证   12232435464  男
李四  身份证   12232435464  男
 for (int i = 0; i < intCount; i++)
        {
          Uname = (this.GridView1.Rows[i].FindControl("lblName") as Label).Text;
          UCidtype = (this.GridView1.Rows[i].FindControl("lblCardType") as Label).Text;
          UCid = (this.GridView1.Rows[i].FindControl("lblCid") as Label).Text;
          Utype = (this.GridView1.Rows[i].FindControl("lblCustType") as Label).Text;
          Emailfo = " " + Uname  + "  " + UCidtype + "  " + UCid + "   " + Utype +"<br>";
        }
Email.Body = Emailfo ;发送只收到
李四  身份证   12232435464  男
应该怎么处理才能让两条或多条都收到呢??

解决方案 »

  1.   

    你只给MailMessage 的body属性赋值,即有内容,但没有To,你一个人是怎么发出去的?
    for (int i = 0; i < intCount; i++)
            {
              Uname = (this.GridView1.Rows[i].FindControl("lblName") as Label).Text;
              Email.To.Add(Uname );
              UCidtype = (this.GridView1.Rows[i].FindControl("lblCardType") as Label).Text;
              UCid = (this.GridView1.Rows[i].FindControl("lblCid") as Label).Text;
              Utype = (this.GridView1.Rows[i].FindControl("lblCustType") as Label).Text;
              Emailfo = " " + Uname  + "  " + UCidtype + "  " + UCid + "  " + Utype +" <br>";
            }
    Email.Body = Emailfo ; 
      

  2.   

    张三  身份证  12232435464  男 
    李四  身份证  12232435464  男 
    for (int i = 0; i < intCount; i++) 
            { 
              Uname = (this.GridView1.Rows[i].FindControl("lblName") as Label).Text; 
              UCidtype = (this.GridView1.Rows[i].FindControl("lblCardType") as Label).Text; 
              UCid = (this.GridView1.Rows[i].FindControl("lblCid") as Label).Text; 
              Utype = (this.GridView1.Rows[i].FindControl("lblCustType") as Label).Text; 
              Emailfo = " " + Uname  + "  " + UCidtype + "  " + UCid + "  " + Utype +" <br>"; 
            } 
    Email.Body = Emailfo ; 发送只收到 
    李四  身份证  12232435464  男 
    我想要的是在一个邮件里面得到
    张三  身份证  12232435464  男 
    李四  身份证  12232435464  男
    或更多的..