Sending email via function in page or setting up the action properly in another page

<form action="_contactform.php" method="post" name="submitform">

Note the action is _contactform.php, a relative URL, not an absolute URL, therefore it will get appended on to the current page.

However, it would be more reliable to submit the form to the same page and leave the action blank, then run the code in WordPress.

This way, at the beginning of the page, you can check to see if the form has been submitted, then handle it. If none of the GET or POST options are present, display the contact form