It is somewhat possible to "send" an email using HTML only and not have any server-side code, but this is not really recommended. Using the mailto: URI scheme, you can set both the Subject, Body of the message, and the sender. You will not be able to determine from whom it is being sent, since an email client that processes the mailto: URI will handle this.
The following is a simple example of a form for a basic contact form. Remember that users will need a program that can handle the URI scheme, and if not, nothing will happen. This does not send the email, but creates it inside the mail application.
<form method="GET" action="mailto: test@example.com " enctype="text/plain"> <div>Subject</div> <input type="text" name="subject" /> <div>Message</div> <textarea name="body"></textarea> <br/> <input type="submit" value="Send" /> </form>
How it works, if quite simple. We use the "GET" method for the form to add attributes to the end of the URI, which should be "subject" and "body". You can learn more about the mailto URI scheme: http://en.wikipedia.org/wiki/Mailto
If you want your contact form to contain even more information, such as "Name", "Phone number" and other information, you can have Javascript to process the form. You can do this by adding an event listener for the "submit" event.
<form method="GET" action="mailto: test@example.com " enctype="text/plain"> <div>Subject</div> <input type="text" name="subject" /> <div>Name</div> <input name="Name" /> <div>E-Mail</div> <input name="E-Mail Address" /> <div>Message</div> <textarea name="Message"></textarea> <br/> <input type="submit" value="Send" /> <input type="hidden" name="body" /> </form> <script> var form = document.getElementsByTagName('form')[0]; form.addEventListener('submit',contact,false); function contact(e) { </script>
The above script will create an email body that looks like this. Of course, you can always add more rules and parsing to the contact function to make it more enjoyable.
subject: a Name: b E-Mail Address: c Message: d