Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
PHP
<?php
if (isset($_REQUEST['email']))  {

  //Email information
  $admin_email = "tripti.shaddhainfonewdelhi@gmail.com";
  $name = $_REQUEST['name'];
  $email = $_REQUEST['email'];
  $address = $_REQUEST['address'];
  $phone = $_REQUEST['phone'];
  $city = $_REQUEST['city'];
  $date = $_REQUEST['date'];

  //send email
  mail($admin_email, "$name", "$address", "$phone","From:" . $email);

  //Email response
  echo "Thank you for contacting us!";
  }

  //if "email" variable is not filled out, display the form
  else  {
?>
<?php
  }
?>
Posted

1 solution

You need to read the PHP documentation for the mail function, http://php.net/manual/en/function.mail.php. It shows how to pass additional parameters when needed. But it looks like you are trying to pass information that should be in the body of the message. You should build the message body and send that as one parameter.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900