When creating a webpage that uses HTML sometimes it can be useful to let the readers to email you at an email address of your choice. To do this it is possible to do this using an HTML anchor tag <a>. These tags are normally used to create a link to another page but they can also be used to send an actual email.
Sending a simple email
As you can see there are two sections to this line of HTML, this is the href parameter with the instruction to mail to an email address and the text that will appear on the actual page (Email Example). This will open up your default emailing application for you to send an email to that address.
Additional Advanced Email HTML Code
With this it’s easy to see that although it’s slightly more advanced it’s fairly self-explanatory. Again there is a href syntax that creates a command to open the email application. It will set the email address to send to but this time there are additional parameters for the email subject and the body for the email. This syntax can be used so that you can populate the email with the information you want from the user. The user will be able to edit the text that is in both the body and subject though so the text that is entered will only be a guideline to them as to what to be included.
Even though the text is still a guideline you are likely to find that they will still leave the included text as it is, or merely add to it. It is often easier for them in the end so make sure it includes everything you need to know when the email is sent.
If you require anything more complicated than this you may find it more useful to use a contact form. This can be written in various languages such as PHP or if using ASP.NET C# is another example. This of course leads to more complicated issues like spam protection and the use of CAPTCHA but this is more advanced than the options covered here.