How can a form be sent as an email to a specific email address in PHP?

To send a form as an email to a specific email address in PHP, you can use the `mail()` function to send the form data as an email. You need to set the recipient email address, subject, message body, and any additional headers if needed. Make sure to sanitize and validate the form data before sending it to prevent any security vulnerabilities.

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $to = "recipient@example.com";
    $subject = "Form Submission";
    
    $message = "";
    foreach ($_POST as $key => $value) {
        $message .= ucfirst($key) . ": " . $value . "\n";
    }

    $headers = "From: sender@example.com" . "\r\n" .
               "Reply-To: sender@example.com" . "\r\n" .
               "X-Mailer: PHP/" . phpversion();

    mail($to, $subject, $message, $headers);
}
?>