Adding fields to PHP mailing script?

Hi,

I have looked at the PHP mailing tutorial with MX on this site made by Sonocular and it works fine no problems there. However I want to have the user at my site send more stuff to me.

The PHP mail script that I need to alter is as follows:

PHP:--------------------------------------------------------------------------------

<?php

$sendTo = "tcarling@yahoo.com";
$subject = “Sent website form”;

$headers = “From: " . $_POST[“name”];
$headers .= “<” . $_POST[“email”] .”>
";
$headers .= "Reply-To: " . $_POST[“email”];

$message = $_POST[“message”];

mail($sendTo, $subject, $message, $headers);
?>


What I am trying to do is add another field say “address” to this and I am not sure how to do it. I have tried doing the following:

PHP:--------------------------------------------------------------------------------

<?php

$sendTo = "tcarling@yahoo.com";
$subject = “Sent website form”;

$headers = “From: " . $_POST[“name”];
$headers .= “<” . $_POST[“email”] .”>
";
$headers .= "Reply-To: " . $_POST[“email”];

$message = $_POST[“message”] "
" $_POST[“address”]

mail($sendTo, $subject, $message, $headers);
?>


but then it doesn’t work at all. Woohoo!

I have also tried adding anoth $ variable and then adding it to the mail line. Unfortunately this does not have the desired effect either :frowning:

Can anybody explain how I would add another, or several more fields using this script?

Thx for any help.