How can I send an email to myself when someone has submitted a form?
To send an email to yourself when someone has submitted a form, you can use the PHP mail() function to send an email notification. You can add this function to the form submission processing code, so that an email is triggered whenever the form is submitted.
// Process form submission
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Your form processing code here
// Send email notification to yourself
$to = "your-email@example.com";
$subject = "Form submission received";
$message = "A form has been submitted on your website.";
$headers = "From: your-email@example.com";
mail($to, $subject, $message, $headers);
}