Results 1 to 4 of 4

Thread: linklabel to open send email ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    467

    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

  2. #2
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: linklabel to open send email ?

    vb Code:
    1. Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
    2.         Process.Start(String.Format("mailto:{0}", "medsont@gmail.com"))
    3.     End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    467

    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

  4. #4
    Lively Member polecat's Avatar
    Join Date
    Jul 2005
    Location
    Wolverhampton
    Posts
    83

    Re: linklabel to open send email ?

    Hi the code should be ok in .net 3.5

    vb Code:
    1. 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
  •  



Click Here to Expand Forum to Full Width