There is error somewhere else in your code related to the $_POST['name'] variable. When I delete this DOM node (input with name="name") and submit data everything working as expected, I've got mail function executed and your script echoed Din melding har blitt sendt!
.
It seems that this script or some of your included scripts generate 404 error exception when you send any unexpected $_POST['name'] data.
I suggest you to try renaming this name="name" to name="from", for example.