Fatal error when trying to get admin email on contact form

Merely having a file in the theme folder does not mean that WordPress will load the file, or that when accessed the file will be loaded in a WordPress context.

There are two ways to approach this that I can think of:

In order to use WordPress functions WordPress needs to load. The easiest way to do that is to let WordPress load the file. Put your code above in the same template that holds your form– presumably that is accessible so WordPress knows about the page. Just submit the form to the same page instead of to a different one. In the absence of strong reasons to do otherwise, this is what I would do.

You could also use the AJAX API to process your form.

Note: There is a kind-of a hack to load WordPress in external files by including wp-load.php but don’t mess with that unless you have a very good idea what you are doing.

Edit:

Based on additional information, I now think a better solution is to create a proper widget for the form.

class Form_Widget_wpse_104728 extends WP_Widget {
  function __construct() {
    $opts = array(
      'description' => 'Display and Process My Form'
    );
    parent::WP_Widget(
      'my-form-content',
      'Some PHP',
      $opts
    );
  }
  function widget($args,$instance) {
    // PHP goes here
    // Your code to process the form
    // Your form itself
  }
}
function register_my_widgets() {
  register_widget('Form_Widget_wpse_104728');
}
add_action('widgets_init','register_my_widgets');

Even better would be to put the whole thing into a plugin so that you can process the form independently on a hook early in the page load.