mail()
function. Remember the mail function will not work on a local server. <?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
Reference:
What is the difference between "let" and "var"?
How do I replace all occurrences of a string?
How to randomize (shuffle) a JavaScript array?
How do I format a date in JavaScript?
How can I get query string values in JavaScript?
How to access the correct `this` inside a callback
How do I check if a directory exists? "is_dir", "file_exists" or both?
How to create an array from a CSV file using PHP