how can i send an e-mail through Outlook using VS 2005

hi,
How can i send an email using outlook 2003? i do know there is a way to send an email but it does not put up the box where the user inputs the destination.
the procedure i have currently works but this time i need to display the box.


  Public Sub Attachment()

        ' Create an Outlook application.
      Dim oApp As Microsoft.Office.Interop.Outlook._Application
        oApp = New Microsoft.Office.Interop.Outlook.Application()

       ' Create a new MailItem.
     Dim oMsg As Microsoft.Office.Interop.Outlook._MailItem
      oMsg = oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
      oMsg.Subject = "Send Attachment Using OOM in Visual Basic .NET"
      oMsg.Body = "Hello World" & vbCr & vbCr

    'oMsg.SenderEmailAddress()
    '    ' TODO: Replace with a valid e-mail address.
'display box to have the user enter the desire destination    
'  oMsg.To = "name@somewhere.com>"

       ' Add an attachment
       ' TODO: Replace with a valid attachment path.
       Dim sSource As String = "C:\billguy.bmp"
       ' TODO: Replace with attachment name
       Dim sDisplayName As String = "Hello.txt"

       Dim sBodyLen As String = oMsg.Body.Length
        Dim oAttachs As Microsoft.Office.Interop.Outlook.Attachments = oMsg.Attachments
       Dim oAttach As Microsoft.Office.Interop.Outlook.Attachment
        oAttach = oAttachs.Add(sSource, , sBodyLen + 1, sDisplayName)

        ' Send
        oMsg.Send()

      ' Clean up
     oApp = Nothing
      oMsg = Nothing
       oAttach = Nothing
       oAttachs = Nothing
    End Sub

my question here is how can i display the Outlook email box to enter the desire destination.
LVL 1
jsctechyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Bob LearnedConnect With a Mentor Commented:
The MailItemClass has the Display method that you can use to display the email that you want to send:

oMsg.Display(New Object())

Bob
0
All Courses

From novice to tech pro — start learning today.