How to Create an Email Link Using HTML Programming

It is always a great experience to the visitors of your website if they have something which makes them communicate easily with you regarding any concerns or queries they have on your website. This is definitely a value added feature for any website. Let’s discuss step by step on how we can add an email link to a webpage using a simple HTML code snippet.


  1. 1
    Utilize the anchor tag (<a>) along with an href="" attribute to begin the link in your HTML document. Href generally gives the browser the link to the item. You'll need to add all HTML code up to this point before crossing any further into the document.
  2. 2
    Gather all the parts you'll need to format your email link syntax. You'll need to have the "mailto:" and the users email line ready.
  3. 3
    Type "mailto:" then the users email (excluding these quotation marks since they were added above) alone. A properly formatted command so-far would be href="mailto%3A" .
  4. 4
    Recognize if you'll need to set a "subject" line pre-fil in your command-link. While most often not used, it is possible to add information to prefill the subject line via the mailto syntax. However, it's more often used when the mail is being sent to a server inside a robot that handles incoming mail so it can be processed later (so it can be filtered).
  5. 5
    Add a subject-line syntax after the email address (optional). Type a question mark followed by the trigger word "subject" followed by an equals sign followed by the subject inside a pair of quotation marks.
    • Try not to use characters that aren't alphanumeric in the subject line. There are ways to work around this so your link doesn't get stumped and thinks it's part of something else".
  6. 6
    Recognize some of the other things you can prefill using the same basic sort of workaround. You can add "body" as well as a cc or a bcc line, just make sure to use a question mark followed by the term "body"/"cc"/"bcc" followed by an equals sign followed by the prefilled text for that line.
  7. 7
    Label your email link. After your ending triangular bracket on the front of the tag, you'll need something to designate this item as an email link. This can be a word, a phrase, or even a duplicate copy of the person's email address this is being sent to. Most often, this can be the phrase "here" or "this" or something of that sort.
  8. 8
    Finish the anchor tag. Anchor tags must have closure for this trick to work and not make the remainder of the page become an extension of the anchor tag. Type </a> to close it off.
  9. 9
    Continue the remainder of the HTML document.


  • The anchor HTML tag <a> tag can be used in different ways. Better to learn about it completely to use it effectively.
  • Anchor tags must be placed inside the <body>...</body> tag section of the page. Don't put it anywhere else or it ends up causing errors or immediately opening the email agent when you load the webpage its listed on, no matter if you are previewing it or your visitor is opening this page, and could cause some aggravation for unintentional opening.


  • If users do not have email client installed on their computer then it would not be possible to send you email.
  • Putting email address on a web page can cause a spamming problem for email accounts. There are many guys over the Internet who can run programs to harvest these types of emails for spamming. So, who puts email link on a public website have to be prepared for anti-spamming as well.
  • Check the recipient name before you send the mail.

Sources and Citations

Article Info

Categories: HTML | Email and Instant Messaging