title: how to attach a file in vb.net email sending program?
body: <p>I'm making a windows form.
  Here is my current code:
  I don't have any idea on how to link the open file dialog with the file that I am going to attach.</p>
  
  <pre><code>    Try
          With OpenFileDialog1
  
              'OpenFileDialog1
              .Filter = "Text files (*.txt)|*.txt|" &amp; "All files|*.*"
  
              If .ShowDialog() = DialogResult.OK Then
  
              End If
          End With
      Catch
          MsgBox("error occured!")
  </code></pre>