I'm using a PHP mail handler to send an enquiry foom from my website.
All is working well except that I would rather the date be formatted differently.
Currently it's sending the date as yyyy-mm-dd
and I would like it to be dd-mm-yyyy
or a long date such as dd-month-yyyy
.
<?php
$myWeb = "My Website";
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$number = trim($_POST['number']);
$message = trim($_POST['message']);
$date = trim($_POST['date']);
$EmailTo = "mymail@myweb.com";
$Subject = "Enquiry from $myweb"; /// Add a subject
$Body = "$name has made an enquiry about: $myWeb
";
$Body .= "Name: $name
";
$Body .= "Email Address: $email
";
$Body .= "Contact Telephone Number: $number
";
$Body .= "Date of Event: $date
";
$Body .= "$name's Enquiry:
$message
";
if($Subject == NULL) {$Subject = "From $myWeb";}
$success = mail($EmailTo, $Subject, $Body, "From: $myWeb");
if ($success){
header('Location: contact-form-thank-you.html','_self');
}
?>
Any ideas please how I would change the format?