Vasanths R

Hi,

I want to open Outlook Express / Outlook ( Depends on availability) on button click of a Vb.Net form

Can any one provide me the sample code

Thanks in Advance




Re: Visual Basic Language How to Open Outlook Express through Vb.Net Code

spotty

 The following will open outlook express.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("msimn.exe")
    End Sub
End Class


 

Otherwise if you just want to open the default email client on the machine to send a message - something like the following should work.

System.Diagnostics.Process.Start("mailto:your@emailAddress.com")

 





Re: Visual Basic Language How to Open Outlook Express through Vb.Net Code

Tdmiller10

Hi there! I'm extremely new to VB and using VS 2005 (developer's edition) to create a simple program for work. It mostly does what I want it to, but the last thing I'd like to have is a feature to open a new email window and use the text from fields that the user will put information into. I can see that the code above opens the mail with an address already filled in, but I will need 2 addresses in the 'To:' box, 2 more for the 'CC:' box, and the subject will have a certain format, but be based on what the user enters. I want the user to send the email as opposed to the application doing it for them.

Is there a way to use the above code to open a new email, and populate it with the text from fields in the app

I have the following code ready based on the objects in the app, but I am unsure how to get the whole thing working together.

Private Sub LinkLabel1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkLabel1.Click

mailTo = ("1staddress@yoohoo.com, 2ndaddress@yoohoo.com")

mailCCSad"1staddress@yoohoo.com, 2ndaddress@yoohoo.com")

mailsubject =("textbox4.text"+ "/" "label13.text" + ", " +"label14.text"+ "/"+ "combobox3.text" +"/" +"Cancellation")

mailBody = TextBox1.Text

End Sub

Is this a feasible goal, and am I on the right track

I appreciate any help given.

Tim