HyperText Markup Language (HTML) contains many different tags, and the HTML email code allows a website owner to add a link directly to his or her email address. A basic HTML email code just points the user to the intended email address. Advanced email code has an automatic subject line and body text, which can help a website owner more quickly determine the email’s purpose. This normally is used on websites so visitors can contact the owner, whether for general or specific purposes. Design elements such as colors and pictures also may be added to the email link.
In its most basic form, HTML email code looks like this: <a href="mailto: firstname.lastname@example.org"> Link Text</a>. There are two customizable sections, the first being the email address. The user should type in his or her email address, or whatever email address should receive the message. Second is the “Link Text” area, which allows the user to enter text that will appear on the website. When the link is clicked, it will bring up the website visitor’s email program, and the email will be automatically addressed to the intended recipient.
A more advanced version of HTML email code allows the user to customize the subject and body of the email, and it looks like this: <a href="mailto: email@example.com?subject=email subject&body=email body"> Link Text</a>. The “Subject” section automatically adds a subject line, while “Body” adds some text to the body. These are both commonly used so the website owner knows what the email is about, and it may be particularly helpful if he or she owns several websites.
HTML email code commonly is on a website so website visitors know how to contact the owner. This typically is used for general comments, but there may be sections in which the website owner adds specific subject and body codes — for example, if the section is for website issues, then the owner may add a subject line that says “Website Issues” or “Website Bugs.” The email tag also can be used in HTML emails sent out to the user’s email list.
This type of code normally appears as a text link with no design elements. If the website owner wants to add a design, such as an image or a different color, this can be achieved with further HTML coding or through cascading style sheets (CSS). A design commonly makes the link stand out more, and it can help the email code fit the website’s aesthetics.