# Advanced email form+php (wrong message output)

**URL:** <https://forum.kirupa.com/t/advanced-email-form-php-wrong-message-output/171814>\
**Category:** Uncategorized\
**Created:** [December 8, 2005, 12:41pm UTC](https://forum.kirupa.com/t/advanced-email-form-php-wrong-message-output/171814 "2005-12-08T12:41:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Active\_webdesig](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Active\_webdesig](https://forum.kirupa.com/u/Active_webdesig)\
**Post date:** [December 8, 2005, 12:41pm UTC](https://forum.kirupa.com/t/advanced-email-form-php-wrong-message-output/171814/1 "2005-12-08T12:41:58Z")

</div>

hey everybody!

For my project I made a form using flash and a php file to send the email.  
This is my first attempt on PHP and my script works but it sends the variables totally wrong into the mailbox.  
I tried everything to make it work and it is driving me crazy!!! :jail:  
The form has to send my vars from flash to my own mailbox and the mailbox of the user whos mailing me.

I faced some problems:

1. You can see when looking at the code below and looking to the message i miss some information in the mail! It doesnt send the first 4 vars into the message!

2. As you can see below the message shows an email addres from the host and i’d like to change that into my own.

3. I dont really think this is a safe code to send the mail cause i dont really like to get my inbox full of spam

4. Some mail clients see this as spam and put it into the unwished email folder so nobody will see this mail.

Hopefully somebody knows to solve some of those issues  
Please help me out with this!  
And I hope to get some explanation with it to understand it in the future…

Greetings  
Dylan

## Message:

## Van: \<[anonymous@eudoris.gvs.nl](mailto:anonymous@eudoris.gvs.nl)\> Verzonden: donderdag 8 december 2005 10:27:35 Aan: [leenvdhoek@hotmail.com](mailto:leenvdhoek@hotmail.com) Onderwerp: Gaswacht Service abonnement

Tel. nr.: 2312313

Merk: qweqwe  
Type: qweqweqweqweqwwqeqqew  
Bouwjaar: 1985  
Abonnement: Mechanische ventilatie box - Incl.  
Abonnement extra: Mechanische ventilatie box - Excl.  
Ingangsdatum: 26/12/2005

Betaalmethode: Elk jaar vooraf betalen.  
Bank/giro nr.:

Opmerkingen: eqweqwe

[supr1mer35@hotmail.com](mailto:supr1mer35@hotmail.com)

```php
<?php
 
$sendTo = "leenvdhoek@hotmail.com";
$cc= $_POST["email"];
$subject = "Gaswacht Service abonnement";
 
 
$headers = "Van: " .$_POST["email"]."<" . $_POST["email"] .">
";
$headers .= "Antwoord naar: " . $_POST["email"] . "
";
$headers .= "Terugkeren: " . $_POST["email"];
 
$message .= "Naam: ".$_POST["naam"]."
";
$message .= "Adres: ".$_POST["adres"]."
";
$message .= "Postcode: ".$_POST["postcode"]."
";
$message .= "Woonplaats: ".$_POST["woonplaats"]."
";
$message .= "Tel. nr.: ".$_POST["telefoon"]."
";
$message .= "
";
$message .= "Merk: ".$_POST["merk"]."
";
$message .= "Type: ".$_POST["type1"]."
";
$message .= "Bouwjaar: ".$_POST["bouwjaar"]."
";
$message .= "Abonnement: ".$_POST["abonnement"]."
";
$message .= "Abonnement extra: ".$_POST["extra"]."
";
$message .= "Ingangsdatum: ".$_POST["ingang"]."
";
$message .= "
";
$message .= "Betaalmethode: ".$_POST["choice"]."
";
$message .= "Bank/giro nr.: ".$_POST["giro"]."
";
$message .= "
";
$message .= "Opmerkingen: ".$_POST["opmerkingen"]."
";
 
mail($sendTo, $subject, $cc, $message, $headers);
 
print "&success=1&"
 
?>

```
