# Formmail PHP

**URL:** <https://forum.kirupa.com/t/formmail-php/295149>\
**Category:** web dev\
**Created:** [August 26, 2009, 12:36am UTC](https://forum.kirupa.com/t/formmail-php/295149 "2009-08-26T00:36:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blimpman](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@blimpman](https://forum.kirupa.com/u/blimpman)\
**Post date:** [August 26, 2009, 12:36am UTC](https://forum.kirupa.com/t/formmail-php/295149/1 "2009-08-26T00:36:52Z")

</div>

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?

```auto
<?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:
