Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Date is outputting two days Re: Date is outputting two days

#108288

I am sending two emails on one file.



$EmailFrom = "TEST";
$EmailTo = "[email protected]";
$Subject = "Contact Us";
$Name = Trim(stripslashes($_POST));
$Phone = Trim(stripslashes($_POST));
$Email = Trim(stripslashes($_POST));
$Message = Trim(stripslashes($_POST));

// validation
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

?>




// CHANGE THE VARIABLES BELOW

$EmailFrom = "TESTTHANK";
$Subject = "Thank You";
$Name = Trim(stripslashes($_POST));
$Email = Trim(stripslashes($_POST));
$date = date('M dd Y');

// prepare email body text


$Body = "";
$Body .= $date."n";
$Body .= "n";
$Body .= "n";
$Body .= $Name . ":";
$Body .= "n";
$Body .= '
I am delighted you contacted us.
';

// send email
$success = mail($Email, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "";
}
else{
print "";
}
?>