title: Datagridview email if specific columns contains certain text
body: <p>I have a data that populates in datagridview after my search is complete. I can email the listed people. I want to add a statement to check column 25 for specific text ("1"), if it finds it then add this recipient.</p>
  
  <p>Thank you for any help!</p>
  
  <pre><code>            Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();
              Microsoft.Office.Interop.Outlook.MailItem mailItem = (Microsoft.Office.Interop.Outlook.MailItem)
              outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
  
              for (int i = 0; i &lt; dataGridView1.Rows.Count; i++)
              {
                  if (dataGridView1.Rows[i].Cells[25].Value != null)
                  {
                      if (dataGridView1.Rows[i].Cells[25].Value.ToString().Contains("1"))
                      {
                          mailItem.To = "test@test.com";
                      }                                            
                  }
              }
              mailItem.To = string.Join(";", c1.Union(c2).Union(c3).Union(c4).ToArray());  
  
          }
          catch (Exception eX)
          {
              throw new Exception("cDocument: Error occurred trying to Create an Outlook Email"
                                  + Environment.NewLine + eX.Message);
          }
  </code></pre>