How do you create an email link?

  • google plus

In Brief...

Use "mailto" to create a link that attempts to open a user's email client and set the "to" address.


A email link is written using the <a> just like a regular link. Just set the href attribute to "mailto:" followed by the user's email address. For example:

<a href="">Email Link Text Here</a>

Some things you will want to consider:

  1. Email links only work if the user has an email client set up. As such, you should consider setting the text of the link to the email address itself so that users who don't have their email clients set up can find the email address.
  2. Email addresses in mailto links are easily discoverable by bots, so don't be surprised if your spam level increases after you use your email address in a mailto link.
  3. You can set a default subject a default subject and body using the subject and body parameters, like this:
    <a href=" War&body=Nice job with that!"></a>

Give it a try

Author: Nat Dunn

Nat Dunn founded Webucator in 2003 to combine his passion for web development with his business expertise and to help companies benefit from both.