HotScripts surely has something that can do all of those very tasks for you. Also, you could try searching this forum because these are pretty basic principles that have been discussed on numerous occasions.
When you have some code in hand, and need help tweaking it, then come on back and we'll help you out. You're going to be hard-pressed to find someone who will just "give" you the code...
Keywords: form validation, email validation, send email, query database