title: How to Send VB.Net DataGridView information in Grid/Table Form via email
body: <p>Can any body help me out in VB.Net [Using Microsoft Visual Basic 2010 Express] that how to send DataGridView [Records/Data has been fetched from Database] information via email using VB.Net. I am able to send email with DataGrid information but not in Grid/Table form. Below is sample Code:</p>
  
  <pre><code>Private Sub btnGUIEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGUIEmail.Click
  
      Dim html As String = String.Empty
      Dim Mail As New MailMessage
  
      mail.Subject = "test email"
      mail.To.Add(TextBox2.Text)
      mail.From = New MailAddress("X@gmail.com")
  
      Dim strAccount_No, strClient_Name As String
  
      Dim i As Integer
      For i = 0 To DataGridView1.Rows.Count - 2
  
       strAccount_No = DataGridView1.Item(0, i).Value.ToString
       strClient_Name = DataGridView1.Item(1, i).Value.ToString
  
        strMailBody += strAccount_No &amp; "     " &amp; strClient_Name &amp; vbCrLf
          Mail.Body = strMailBody
       Next
  
     Dim SMTP As New SmtpClient("smtp.X.com")
      SMTP.EnableSsl = True
      SMTP.Credentials = New System.Net.NetworkCredential("X@gmail.com", "X")
      SMTP.Port = "587"
      SMTP.Send(Mail)
      MsgBox("Email Sent")
  
  
  End Sub
  </code></pre>
  
  <p>Can any body help me out in VB.Net [Using Microsoft Visual Basic 2010 Express] that how to send DataGridView [Records/Data has been fetched from Database] information via email using VB.Net. I am able to send email with DataGrid information but not in Grid/Table form. Below is sample Code:</p>