
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Create Email Link with Subject in HTML
To create a link to send email, use <a> tag, with href attribute. The mail to link is added inside the <a> tag. To add a subject, you need to add ? and then include the subject. All this comes inside the <a> tag.
Just keep in mind to add the email address where you want to receive the email in the mail to link. Also, the spaces between words for the subject shouldn’t be space, instead include %20. This is to ensure the browser displays the text properly.
Example
You can try to run the following code to create a link to send an email with a subject in HTML.
<!DOCTYPE html> <html> <head> <title>HTML Email with subject</title> </head> <body> <h1>Contact</h1> <p>For any queries:<a href="mailto:[email protected]?Subject=My%20Query">Contact us</a></p> </body> </html>
Advertisements