Variable email address
am 30.11.2007 19:06:41 von windub
Hi...
I would like to capture an email address from a form and send a copy
of the mail to that user. Can anyone give the correct code?
Below is the script I am using.
Thanks for your help.
/
$sendTo = "peter@deahipprovider.co.uk";
$subject = "New Enquiry";
$headers = "From: " . $_POST["firstname"] ." ". $_POST["lastname"] .
"<" . $_POST["email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
$sendTo = ["email"];
?>
Re: Variable email address
am 01.12.2007 00:49:26 von Acrobatic
Your $sendTo isn't really variable, it's set to a static email
address. You might want to change that to
$sendTo = $_POST['email']
before you issue the "mail" command.
On Nov 30, 12:06 pm, windub wrote:
> Hi...
>
> I would like to capture an email address from a form and send a copy
> of the mail to that user. Can anyone give the correct code?
>
> Below is the script I am using.
>
> Thanks for your help.
>
>
> /
> $sendTo = "pe...@deahipprovider.co.uk";
> $subject = "New Enquiry";
>
> $headers = "From: " . $_POST["firstname"] ." ". $_POST["lastname"] .
> "<" . $_POST["email"] .">\r\n";
> $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
> $headers .= "Return-path: " . $_POST["email"];
>
> $message = $_POST["message"];
>
> mail($sendTo, $subject, $message, $headers);
> $sendTo = ["email"];
>
> ?>