It’s not done in HTML, it’s done in a server-side script such as PHP or Ruby or Python, etc. Most servers have at least one of the above languages installed, so you can probably look for a PHP or PERL script to do that for you. Hotscripts.com is a good place to look. Just start with PHP or PERL or whatever your server supports, then find the contact or mail scripts, etc. You can also go with a service like Wufoo.com to handle everything for you.