0

So I'm using this code for php mail and I keep getting MY email address rather than the actualy senders email, when I test it on my website's contact form. Any help? By the way, I use my email in the recipients address.

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$website = $_POST['website'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Type: $type \n  Message:      $message";
$recipient = "myemail@address.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
?>
Esteban Rodriguez
  • 527
  • 1
  • 5
  • 11

1 Answers1

1

Have a look at php:mail manual in the example#3 you can see,

<?php
mail('nobody@example.com', 'the subject', 'the message', null,'-fwebmaster@example.com');
?>

You can see

The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path.

NewUser
  • 3,729
  • 10
  • 57
  • 79
  • I'm a PHP noob, so can you break it down to me? What exactly do I put in my form in order to get emails displaying the actual senders email rather than my email? – Esteban Rodriguez Jun 07 '13 at 20:14