Ubuntu server, my contact form on website is not working
by master from LinuxQuestions.org on (#57JWX)
Hi, My website was hosted on a GoDaddy Windows server and I had a working contact form which was great.
I have now got that website up and running on GoDaddy's Gen4 VPS Ubuntu 16.04
The problem is my contact form is throwing an error Cannot POST /mail.php
mail.php is referring to the php file my html file checks
PHP Code:<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "My Email Here";
$subject = "My Email Subject Here";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>I dont believe the PHP to be at fault. I believe I simply need to set something else up on the server. I have PHP-V 7.0.33 installed running apache.
Im hoping someone has had this same issue and can help out. Basically I just need to get my contact form working.
Thanks.


I have now got that website up and running on GoDaddy's Gen4 VPS Ubuntu 16.04
The problem is my contact form is throwing an error Cannot POST /mail.php
mail.php is referring to the php file my html file checks
PHP Code:<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "My Email Here";
$subject = "My Email Subject Here";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>I dont believe the PHP to be at fault. I believe I simply need to set something else up on the server. I have PHP-V 7.0.33 installed running apache.
Im hoping someone has had this same issue and can help out. Basically I just need to get my contact form working.
Thanks.