# Help in php mail form AS 2

**URL:** <https://forum.kirupa.com/t/help-in-php-mail-form-as-2/319088>\
**Category:** Uncategorized\
**Created:** [February 8, 2011, 6:18pm UTC](https://forum.kirupa.com/t/help-in-php-mail-form-as-2/319088 "2011-02-08T18:18:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![worthless](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@worthless](https://forum.kirupa.com/u/worthless)\
**Post date:** [February 8, 2011, 6:18pm UTC](https://forum.kirupa.com/t/help-in-php-mail-form-as-2/319088/1 "2011-02-08T18:18:44Z")

</div>

I have a contact form and I use flash and Php to send information. The form is working perfect with one problem. If I use more than one word in the Name field it shows “unknown sender” in the mail form. If I use only one word like “Ram” the received mail form shows it correctly. Why the php code behave like this I do not know but presume that the I have to amend something in the headers section. One more thing I want if someone enter a valid email account he will get one instant mail confirmation while posting the mail. Is it possible to enhance the code? Please help and look into the code, please…

```auto
<?PHP
// read the variables from the string, (this is not needed with some servers).
$theName = $_REQUEST["theName"];
$theEmail = $_REQUEST["theEmail"];
$theTelephone = $_REQUEST["theTelephone"];
$cb_country1 = $_REQUEST["cb_country1"];
$payment = $_REQUEST["payment"];
$theMessage = $_REQUEST["theMessage"];
$to = "xxxxxx@gmail.com";
$subject = "General Feedback Form";
$message = "Name:" . $theName;
$message .= "
Email:" . $theEmail;
$message .= "
Telephone:" . $theTelephone;
$message .= "
Payment:" . $payment;
$message .= "
Country:" . $cb_country1;
$message .= "
Message:" . $theMessage;

$headers = "From: $theName";

// I think this above code has to be changed. 
$headers .= "
Reply-To: $theEmail";
$sentOk = mail($to,$subject,$message,$headers);
echo"sentOk=" . $sentOk;

?>

```
