• 0

How to get clicking on LinkLabel to open mailto?


Question

I am using Microsoft Visual Studio Community 2015.

 

I have added a LinkLabel ("LinkLabel1") and changed the text to read "E-mail us"

 

Now how do I get it to actually compose an e-mail when it's clicked?

 

I can't find the option in the Properties dock.

 

When I double-click on the LinkLabel1, it shows:

 

Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked

End Sub

 

What do I paste there?

 

I am a beginner - go easy on me!

 

EDIT: Found the answer: Process.Start("mailto:bla.bla@Bla.com")

 

Now to figure out how to automatically add a subject to the e-mail...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Found this on Stackoverflow, doesn't know if it works.

<A HREF="mailto:you@yourdomain.com?subject=Your Subject&body=Message for the body">you@yourdomain.com</a>

 

or this in C#

 

   public static void SendMailWithMailTo(string address, string subject, string attach)
    {     
        string mailto = string.Format("mailto:{0}?Subject={1}&Body={2}&Attach={3}", address, subject, body, attach);
        System.Diagnostics.Process.Start(mailto);
    }

Link to comment
Share on other sites

  • 0

It's a lot simpler lol

Instead of using a  url as value for the href attribute use the following: "mailto:person@stalk.me".

Link to comment
Share on other sites

  • 0
4 hours ago, Elliot B. said:

EDIT: Found the answer: Process.Start("mailto:bla.bla@Bla.com")

 

Now to figure out how to automatically add a subject to the e-mail...

http://www.tutorialspark.com/html5/HTML5_email_mailto.php

 

This is all plain html, no visual studio code whatesoever. Never understood why anyone ever wanted to make a html page in visual studio :s

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.