In http://www.ibdhost.com/contact/ you can find useful examples for the same problema.
Artmedic provides lots of freeware php scripts on their website http://www.artmedic-phpscripts.de/. The script kontaktformular can be used to provide contact means to website users. It is a simple php script with an installation routine. Although this script is very simple, it has some securtiy features and was tested and is still maintained.
Although it is very simply to build such a script on your own, it is easier and more secure to take an existing script.