Contact form – ajax, wp_mail

From quick look at your code you seem to be omitting where you are submitting request to. By default it is just current page, which isn’t typically equipped to receive the request.

Since you are using wp_ajax_ hook you need to point request at admin-ajax.php endpoint. On admin side the URL is provided in ajaxurl JS variable, on front end side you would need to provide it to your code yourself.