PHP mail() - Formatting date in body..
Posted: Wed Jul 07, 2004 9:13 am
Hello.. I'm a little new to PHP and I've come a bit unstuck.
I've managed to create a form that submits it's data to a MySQL database and also sends an email to a set list. Within the email I want to print the date in a D, d, Y format... the form is providing the date as a TIMESTAMP which I need for the database, so I can't just reformat that.
My email code goes as such:
This works (I'm aghast I got this far), but I need to get the date in a readable format rather just 20040808041217 (TIMESTAMP) value.
Hope I've make this clear.. Any pointers would be great
I've managed to create a form that submits it's data to a MySQL database and also sends an email to a set list. Within the email I want to print the date in a D, d, Y format... the form is providing the date as a TIMESTAMP which I need for the database, so I can't just reformat that.
My email code goes as such:
Code: Select all
//Begin Email
if ((isset($_POSTї"MM_insert"])) && ($_POSTї"MM_insert"] == "add_event"))
{
$msg = "Event added for Date:\t$date\n" ;
$msg .= "Appointment:\t$text\n";
$recipient = "xxx@xxx.co.uk";
$subject = "Week Ahead Update";
$mailheaders = "From: xxx <> \n";
$mailheaders .= "Reply-To: $xxx@xxx.co.uk\n\n";
mail($recipient, $subject, $msg, $mailheaders);
}
//End EmailHope I've make this clear.. Any pointers would be great