views:

199

answers:

1

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.

    Try
        With OpenFileDialog1

            'OpenFileDialog1
            .Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"

            If .ShowDialog() = DialogResult.OK Then

            End If
        End With
    Catch
        MsgBox("error occured!")
+1  A: 

Something similar to..

Dim attach As MailAttachment = New MailAttachment(openFileDialog1.FileName) 


Email.Attachments.Add(attach)
JTA
is the code that above(my code) still usable?
how can I define mail attachment