How to Create Email Links in HTML

Author: Louise Ward
Date Of Creation: 8 February 2021
Update Date: 1 July 2024
Anonim
HTML Tutorial   How to Create an Email Link Using HTML
Video: HTML Tutorial How to Create an Email Link Using HTML

Content

Visitors will have a great experience if they can easily contact you about any concerns or questions that arise while viewing the website. This must be a feature that adds value to every website. Let's walk through the steps to add an email link to a web page with just one simple snippet of HTML.

Steps

  1. Enter the anchor tag into the HTML document. Properties "


    Import mailto: after "=". This code tells the browser that the following link leads to an email address, not a web page.
  2. Next, enter the user's email. The properly formatted command so far will be [email protected]’.

  3. Add a pre-made subject line (optional). If you want to add a pre-made subject, enter a question mark (?) After the user's email address, followed by the word "subject" (without the quotes), to the equal sign (=), and finally the inner Subject content is inside quotes.
    • If you wanted to add this element, the command would look like this: [email protected]?subject= "subject text"
    • Try not to use non-alphanumeric characters in the subject line. There are ways to limit this to prevent the link from getting confused or mistaking that those characters are part of something. "
    • While not as popular, you can still add information to pre-populate the subject line via mailto syntax. This technique is used more when the message is forwarded to an internal server where the bots continue to process the message, and the email is filtered again later based on the subject line.
    • You can add the "body" part as well as the cc or bcc lines with the same syntax. Just be sure to use the quotes, followed by the keywords "body", "cc" or "bcc", then the equal sign and finally the text for that line in double quotes.

  4. Import > to add a closing bracket. So far, our HTML commands are telling the browser the associated email address and adding a subject / cc / bcc. The ">" closing brace tells the browser that there are no more commands to execute after the link is clicked.
  5. Enter the link text. This is the text that the user will click to open the email link. This content is after the closing bracket. This could be a word, sentence or even a duplicate copy of the email address to be mailed to. Usually, this text could be a sentence "here", "here" or something similar.
  6. Import after the link text. The HTML command will close. The HTML anchor tag must be closed for this trick to work and should not mislead the rest of the page as an anchor tag extension.
    • The entire HTML email link command looks like this: [email protected]?subject= "HTML link"> Click here to email us !!!
  7. Continue the rest of the HTML document. Don't forget to save your session. If you have a lot of HTML commands to add to the document, then continue. advertisement

Advice

Warning

  • Putting an email address on a website can cause your account to be spammed. There are many objects on the Internet running programs that collect emails of this type for the purpose of sending spam. So, if you put the email link on a public website, you should be prepared to deal with this issue as well.
  • Check the recipient's name before sending the mail.
  • If the user does not have an email client installed on their computer, they may not be able to send you email.