Automating Applications Question

P

plangla

I am trying to start the default e-mail browser automatically from a menu
item click. The code works for the web browser but not for e-mail.

This is the sample for web browser that works

Private Sub MenuItem25_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem25.Click

System.Diagnostics.Process.Start("http://www.company.com")

End Sub



This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub



I am not sure what is wrong. Please help

Thanks Perry Langla
 
L

Lloyd Sheen

plangla said:
I am trying to start the default e-mail browser automatically from a menu
item click. The code works for the web browser but not for e-mail.

This is the sample for web browser that works

Private Sub MenuItem25_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem25.Click

System.Diagnostics.Process.Start("http://www.company.com")

End Sub



This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub



I am not sure what is wrong. Please help

Thanks Perry Langla

Problem is that system does not have a default for (e-mail address removed).

To see this start button run and then type in the address. You will get the
message that windows does not know what to do with it. Now put
mailto:[email protected] and it should start a new message in your mail
program.

The version of Process.Start you are using assumes that a filename /URL will
have a default program associated with it. mailto: is an association in
most windows environments.

Hope this helps
Lloyd Sheen
 
G

Guest

This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub

try: System.Diagnostics.Process.Start("mailto:[email protected]")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top