The form below should send all details to my email but its only sending message and organization ? what wrong with it? thanks <?php ob_start(); $name=$_POST['name']; $email=$_POST['email']; $count=$_POST['count']; $orga=$_POST['orga']; $message=$_POST['message']; $result = mail($email, $orga, $count, $headers, $message); $headers = "From: $email"; include "functions.php" if ($name=="" || $email=="" || $orga=="" || $message=="" || $count=="") { echo "All fields are mandatory!"; } else { mail("xxxxxx@googlemail.com", $name, $orga, $message, $header); echo "Your message successfuly sent. Now you are redirecting to homepage!."; } header("refresh: 2; url=http://www.xxxxxx.org"); ?> PHP:
nico_swd is right... You need to sort out the mail command: It should be in this format... mail($to, $subject, $message, $from); PHP: You have also called the variable '$headers' before you've creating the variable! I'm also not overly sure why you've created a variable called result as it never gets used? What are you trying to do? I'm assuming this is for a contact form? If you're wanting to take the information and then email yourself the results you'll need something like this: <?php ob_start(); $your_email="xxxxxx@googlemail.com"; $subject="Subject Line"; $name=$_POST['name']; $email=$_POST['email']; $count=$_POST['count']; $orga=$_POST['orga']; $message=$_POST['message']; $from = "From: " . $email . "\r\n"; $build_email = "Name: " . $name . "\nEmail: " . $email$ . "\nCount: " . $count . "\nOrganisation: " . $orga . "\nMessage: " . $message; if ($name=="" || $email=="" || $orga=="" || $message=="" || $count=="") { echo "All fields are mandatory!"; } else { mail($your_email, $subject, $build_email, $from); echo "Your message successfuly sent. Now you are redirecting to homepage!."; } header("refresh: 2; url=http://www.xxxxxx.org"); ?> PHP: