This is my HTML form, which is inside a little box on my site.
In the code you posted, you attempted to set the value of $body
on line 13, but did not set the value of $name
until line 22. $name
is null at the time you assign it to $body
, so $body
does not contain the values you are hoping for.
To fix this problem, move the $body = ...
line below the other assignments. Something like this:
...
// Get form var's
$name = "Test"; // I set $name to "Test" in the PHP and still the variable does not appear in the email.
$destin = $_POST['destin'];
$email = $_POST['Email'];
$pfrom = $_POST['pfrom'];
// Populate $body
$body = $name . " wants to go to " . $destin . " from " . $pfrom;
...