form to email php code help
Posted: Thu Oct 28, 2010 8:58 am
I am trying to create a php code to send info from my html form to an email address, so below is my code:
$name = $_POST['name'];
$body = "This is an email from: $name";
$success = mail($webMaster, $emailSubject, $body, $headers);
I can receive the email, but all I got in the email body is "This is an email from:". I can not get anything related to what I input as $name. I am pretty sure the value name in my html is 'name'.
Anyone could help?
Thank you.
$name = $_POST['name'];
$body = "This is an email from: $name";
$success = mail($webMaster, $emailSubject, $body, $headers);
I can receive the email, but all I got in the email body is "This is an email from:". I can not get anything related to what I input as $name. I am pretty sure the value name in my html is 'name'.
Anyone could help?
Thank you.