I am completely new to PHP scripts and have put together the following code, but I would like the email received to show it is sent from the email field in the HTML form rather than the current "The Tranquility Zone Website [[email protected]]". Please can you advise what I should change. Many thanks.
<?
$msg .= "Name:\t $_POST[name]\n";
$msg .= "E-mail:\t $_POST[email]\n";
$msg .= "Telephone:\t $_POST[telephone]\n";
$msg .= "Subject:\t $_POST[subject]\n";
$msg .= "Message:\t $_POST[message]\n";
$to = "[email protected]";
$subject = "Website feedback message";
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
$mailheaders = "From: The Tranquility Zone Website <www.tranquilityzone.co.uk>\n";
$mailherders .= "Reply to: $_POST[sender_email]\n";
header( "Location: http://www.tranquilityzone.co.uk/thank_you.html" );
@mail ($to, $subject, $msg, $mailheaders);
?>
Change your code to this:
<?php
$msg .= "Name:\t ".$_POST['name']."\n";
$msg .= "E-mail:\t ".$_POST['email']."\n";
$msg .= "Telephone:\t ".$_POST['telephone']."\n";
$msg .= "Subject:\t ".$_POST['subject']."\n";
$msg .= "Message:\t ".$_POST['message']."\n";
$to = "[email protected]";
$subject = "Website feedback message";
$headers = 'From: '.$_POST['email']."\r\n".'Reply-To: '.$_POST['email']."\r\n" .
$mailheaders = "From: ".$_POST['email']."\n";
$mailheaders .= "Reply to: ".$_POST['email']."\n";
header( "Location: http://www.tranquilityzone.co.uk/thank_you.html" );
@mail ($to, $subject, $msg, $mailheaders);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With