-
Oct 5th, 2011, 05:51 AM
#1
Thread Starter
Hyperactive Member
linklabel to open send email ?
Hi, how would i make a link label open the default email app to send an email ?
Like for eample
Contact me: CLICK HERE
The "CLICK HERE" would be the link label
Thanks for any help
-
Oct 5th, 2011, 05:56 AM
#2
Addicted Member
Re: linklabel to open send email ?
vb Code:
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Process.Start(String.Format("mailto:{0}", "medsont@gmail.com")) End Sub
-
Oct 5th, 2011, 08:49 AM
#3
Thread Starter
Hyperactive Member
Re: linklabel to open send email ?
I get this error:
System.ComponentModel.Win32Exception was unhandled
ErrorCode=-2147467259
Message="No application is associated with the specified file for this operation"
NativeErrorCode=1155
Source="System"
StackTrace:
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Proxy_IP.Form4.LinkLabel2_LinkClicked(Object sender, LinkLabelLinkClickedEventArgs e) in C:\Users\Gemster\Documents\Visual Studio 2008\Projects\ProxyMyIP\ProxyMyIP\Form4.vb:line 12 at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Label.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at Proxy_IP.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Thanks
-
Oct 5th, 2011, 02:47 PM
#4
Lively Member
Re: linklabel to open send email ?
Hi the code should be ok in .net 3.5
vb Code:
System.Diagnostics.Process.Start(String.Format("mailto:{0}", "medsont@gmail.com"))
also
Code:
Message="No application is associated with the specified file for this operation"
You need to set the default mail application in windows.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|