I want a copy of each email sent from my HTML online form to create a log file in my server root filepath, which each phpmail() sent, adding to the log file.
I am using the current php post file. Is there any method to do it?
<?php
$webmaster_email = ("myemail@domain.co.uk");
$email_address = $_REQUEST['email'] ;
$comments = $_REQUEST['comment'] ;
$telephone = $_REQUEST['telephone'] ;
$first_name = $_REQUEST['name'] ;
$msg =
"Name: " . $first_name . "\r\n" .
"Email: " . $email_address . "\r\n" . "\r\n" .
"Phone No: " . $telephone . "\r\n" . "\r\n" .
"Comments: " . $comments ;
mail( "$webmaster_email", "Contact Form Results", $msg );
?>
So basically all the Request statements and current time/date into a log file, is this even possible with php?