I’ve attached the below PHP code to my email form but for some reason when I receive emails it doesn’t show a subject.
Any reason why?
<?php
$emailSubject = 'EMAIL_FORM_SUBJECT';
$webMaster = 'my_email_address.com';
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$phoneField = $_POST['phone'];
$howField = $_POST['how'];
$dateField = $_POST['date'];
$serviceField = $_POST['service'];
$methodField = $_POST['method'];
$messageField = $_POST['message'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br><br>
Email: $emailField <br><br>
Phone: $phoneField <br><br>
How did you hear about us: $howField <br><br>
Wedding Date: $dateField <br><br>
Service Type: $serviceField <br><br>
Preferred Contact Method: $methodField <br><br>
Message: $messageField <br><br>
EOD;
$headers = "From: $emailField
";
$headers .= "Content-type: text/html
";
$success = mail($webMaster, $emailsubject, $body, $headers);
$theResults = <<<EOD
<!--ADD THANK YOU PAGE HERE -->
EOD;
echo "$theResults";
?>
Below is the layout I receive from the above code:
From:
Date:
To:
Name:
Email:
Phone:
How did you hear about us:
Wedding Date:
Service Type:
Preferred Contact Method:
Message: