This code i use for my contact form. but when i received from my email
This is result:
Email: <br> Name: <br> Phone number: <br> Comments: <br>
This is PHP code. Can someone help me fix and explain why. Thanks for your support.
<?php /* Subject and Email Variable*/ $emailSubject = 'Email from Clients'; $to = 'email@example.com'; /* Gathering Data Variables */ $nameField = $_POST['name']; $emailField = $_POST['email']; $phonenumberField = $_POST['phonenumber']; $commentsField = $_POST['comments']; $body = <<<EOD Email: $email <br> Name: $name <br> Phone number: $phonenumber <br> Comments: $comments <br> EOD; $header = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($to, $emailSubject, $body, $header); /* Result sender */ echo "Your Email sent to us. Thank for your inquiries. We will reply you within 24 hours"; ?>