I've tried to put the sendfrom email =
bookings@domain.com as well but it is being overridden by the client login and domain name.
What I'd like is for the person who's entered their email address to be the address used in the 'sendfrom'. Any help would be much appreciated.
Thanks
<?php session_start(); ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
ob_start();
//get action
$a = @$HTTP_POST_VARS["a"];
if (empty($a))
{
$a = "I"; //display with input box
}
$x_Name = @$HTTP_POST_VARS["NAME"];
$x_Email = @$HTTP_POST_VARS["EMAIL"];
$x_Phone = @$HTTP_POST_VARS["PHONE"];
$x_Details = @$HTTP_POST_VARS["DETAILS"];
switch ($a)
{
case "I": // Get a record to display
break;
case "E": // Update
// Send info to Site Administrator
ini_set("sendmail_from",@$HTTP_POST_VARS["EMAIL"]);
ini_set('SMTP', "LOCALHOST");
$message = "Booking Enquiry: \n------------------------\n";
$message .=str_pad("Name", 30)."\t".$x_Name."\n";
$message .=str_pad("Phone", 30)."\t".$x_Phone."\n";
$message .=str_pad("Email", 30)."\t".$x_Email."\n\n";
$message .=$x_Details."\n";
$email = "me@mywebsite.com";
mail($email, "Booking Enquiry", $message);
header("Location: thanks.htm");
break;
}
?>