problem with ajax contact forms

You want to be using the AJAX API instead of trying to load files directly. Even if you got that file to load, if it uses any WordPress functions it wouldn’t work anyway. If you load a theme file directly none of the WordPress Core will boot and so none of the function will be defined.

The Codex article should be sufficient for getting that working but this site is full of questions and answers concerning it. I have written about 30 at this point. See if you can’t get started and then refine the question if you run into trouble.