How to Create an Email Link in HTML
How to Create an Email Link in HTML
Do you want to make it easy for your website visitors to send you an email? Creating an HTML mailto link makes it so your visitors can quickly send you a message just by clicking a hyperlink that opens a new message to the email address of your choice. We'll show you the proper tags and syntax to use to create simple HTML email hyperlinks on your website.
Steps

Type the anchor tag

Type mailto: after the "=" sign. This tells the web browser that the following link is to an email address, rather than a web page.

Type the users email next. A properly formatted command so-far would be [email protected]" .

Add a pre-made subject-line (optional). If you wish to add a pre-made subject, type a question mark (?) after the user's email address, followed by the word "subject" (without the quotation marks), followed by an equals sign (=), followed by the subject inside a pair of quotation marks. If you want to add this to your command, it should look like this so far: [email protected]?subject="subject text" 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". 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). You can add "body" as well as a cc or a bcc line using a similar syntax. Just make sure to use a question mark followed by the term "body","cc", or "bcc" followed by an equals sign followed by the text for that line in a pair of quotation marks.

Type > to add a closing bracket. So far, our HTML commands tell the web browser what email address to link to, and to add a subject/cc/bcc. The closing bracket ">" tells the web browser that there are no more commands to execute when the link is clicked.

Type link text. This is the text the user clicks on to open the email link. It goes after the closing bracket. 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.

Type after the link text. This closes the HTML command. HTML 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. The entire HTML email link command should look something like this: [email protected]?subject="HTML link">Click here to send us an email!!!

Continue the remainder of the HTML document. Be sure to save your work. If you have more HTML to add to your document, continue your work.

What's your reaction?

Comments

https://umorina.info/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!