Geekers - Links in HTML are usually in the form of URLs that will direct you to a website page or to a certain part of the website. But it turns out that links in HTML are not only that, you can also create links that directly direct you to certain emails.
How to Create Email Links in HTML
An email link in HTML is a link that contains an email address when you click on it. The application for sending e-mail on your device will automatically open and the destination or destination e-mail address will be automatically filled in with the pre-defined address.
To make the link is of course very easy and simple. You don't need a lot of code or script, you only need one line of script. Immediately, please refer to the following explanation.
List of contents
* How to Create Email Links in HTML
+ 1. Creating Email Links in HTML
+ 2. Added Subject and Body Email
1. Creating Email Links in HTML
The email link in HTML aims to make it easier for the user or users when sending an email. Making email links in HTML is of course very easy. You don't need a CSS or JavaScript script or anything else. You don't even need any plugins. You only need to use the <a href> tag, just like when you create a link to a certain page. Immediately, here is an example script that you can use.
<body>
<a href="mailto:example10@gmail.com">Send Email</a>
</body>
Maybe usually when you create a link to a certain website page using the http:// or https:// protocol. Unlike the email link this time using mailto: . That way the system will know the link is an email address so it will automatically open in the email client you are using.
Like the example script above, the destination email address is written after mailto: . The display will be like the image below.
How to Create Email Links in HTML How to Create Email Links in HTML
When you or the user clicks on the link, an email client will open, such as Outlook, Gmail, and so on according to what is installed on the user's device. Of course, you can also add CSS scripts to make it look more beautiful. Good luck!
2. Adding the Subject and Body of the Email
Then, what if you want to create an email link where the subject and body automatically appear at the email address to be addressed by default? Can it?
Of course you can. In HTML, you can not only create links that go directly to email addresses, but you can also set the subject and body of the email itself. Then, how? The method is quite simple, you still don't need CSS or JavaScript scripts. Immediately, see the sample script below.
<body>
<a href="mailto:example10@gmail.com?subject=This%20is%20title%20email%20default&body=Message %20this%20will%20%20automatically%20appears%20you%21">email@domain.com</a >
</body>
Actually the method is the same as creating a regular email link, but there is a little additional code, namely:
1. Add parameter ?subject= after the destination email.
2. After the subject, write the message you want. For spaces use %20. Like the script above.
3. Then, at the end of the text, add the parameter &body= . This is to include the message in the body of the email.
4. After that, please enter the message you want and don't forget to use %20 space.
Please follow the steps above for the appropriate result. Good luck!
So many articles this time that discuss about how to easily create an email link in HTML. This link can not only go to an email, but can also immediately make a subject along with the body of the email. Hopefully this article can be helpful and useful for you. Thank you 🙂