HTML
HTML introduction
HTML basics
HTML colors
HTML backgrounds
HTML text
HTML font
HTML text formatting
HTML entities
Display tags
HTML links
Email links
Types of links
HTML images
HTML image maps
HTML tables
HTML frames
HTML forms
Fieldset/legend tags
HTML stylesheets
Div/span tags
HTML layout
HTML marquees
HTML multimedia
HTML meta tags
HTML document types
HTML base tag
HTML scripts
URL formatting
Encoding and decoding
HTML summary

Programming

Programming intro
Java

Markup

First webpage guide
XHTML

Style & Layout

CSS

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

Email links

You can create links on webpages not just to other webpages and resources, but to an email message as well.

This lesson focuses on:

Creating a basic email link

To create a basic email link the <a> tag is used just as it is used for regular links but instead of the href attribute taking the value of a URL, it takes the value of mailto: followed by the email address that the message will be sent to.

Example:

<a href="mailto:admin@landofcode.com">Contact us!</a>

Output:

Contact us!

Click on the above link and it will open a new email message in your email program with the "to" field already filled in.

A more complex email link

You can create even more complex email links that fill in the subject as well as the body of the email, not just the email address that the message will be sent to.

Example:

<a href="mailto:admin@landofcode.com?subject=Hey&body=Hello, cool website!">Contact us!</a>

Output:

Contact us!

Click on the above link and it will open a new email message in your email program with the "to" field already filled in as well as the subject field filled in with the value "Hey" and the body of the email filled in with the value "Hello, cool website!"

Practice

Online code editor
Practical examples
Practical exercises
Step-by-step tutorials

Reference

Terms glossary
Reference material

Rate this site

Rate this site
Visitor comments