I have a contact form on my website contact page with the following code
$name = $_POST['name'];
$mob = $_POST['mob'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "myemail";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You for contacting mywebsite ! <br> We will get back to you shortly.";
I am receiving blank emails only, without any content and details.
Godaddy customer service guys are giving parroted scripts only.
Please help ASAP.
I believe you need to split out the variables out side the quotes and join it with .
So it would be
$formcontent="From: ". $name . "\n Message: " . $message;
Here is example that shows this as well - https://www.freecontactform.com/email_form.php
You would need this for your header as well
Once your issue is resolved,
please be sure to come back and click accept for the solution